图片资源

准备一些静态资源文件,如下

assets
images
exception
403.svg
404.svg
500.svg
developing.svg
load-error.svg
nodata.svg

下载地址:

样式资源

transition

动画样式,下载地址:

创建src/styles/transition/index.less,填入以下内容:

styles/index.less
@import './base.less';
@import './fade.less';
@import './scale.less';
@import './slide.less';
@import './scroll.less';
@import './zoom.less';

.collapse-transition {
transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out;
}

common

创建src/styles/common.less,填入以下内容:

#app,
body,
html {
height: 100%;
}

body {
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei,
'\5FAE\8F6F\96C5\9ED1', Arial, sans-serif;
line-height: 1.5;
color: #515a6e;
font-size: 14px;
background-color: #f7f7f7;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

//重置样式
.anticon {
svg {
vertical-align: initial;
}
}

a {
color: #2d8cf0;
background: transparent;
text-decoration: none;
outline: none;
cursor: pointer;
transition: color 0.2s ease;
}

a:active,
a:hover {
outline-width: 0;
}

a:hover {
color: #57a3f3;
}

a:active {
color: #2b85e4;
}

a:active,
a:hover {
outline: 0;
text-decoration: none;
}

/* 滚动条凹槽的颜色,还可以设置边框属性 */
*::-webkit-scrollbar-track-piece {
background-color: #f8f8f8;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}

/* 滚动条的宽度 */
*::-webkit-scrollbar {
width: 9px;
height: 9px;
}

/* 滚动条的设置 */
*::-webkit-scrollbar-thumb {
background-color: #ddd;
background-clip: padding-box;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}

/* 滚动条鼠标移上去 */
*::-webkit-scrollbar-thumb:hover {
background-color: #bbb;
}

/* router view transition */
.zoom-fade-enter-active,
.zoom-fade-leave-active {
transition: transform 0.35s, opacity 0.28s ease-in-out;
}

.zoom-fade-enter-from {
opacity: 0;
transform: scale(0.97);
}

.zoom-fade-leave-to {
opacity: 0;
transform: scale(1.03);
}

//antd 卡片样式定制
body .n-card {
transition: all 0.2s ease-in-out;
}

body .n-icon {
vertical-align: middle;
}

body .proCard {
border-radius: 4px;

.n-card__content {
padding: 16px;

&:first-child {
padding-top: 16px;
}
}
}

body .n-modal {
border-radius: 6px;
}

//body .proCardTabs{
// .n-card__content{ padding-top: 3px}
// .n-card__content:first-child{ padding-top: 3px}
//}

.n-layout-page-header {
margin: 0 -10px;
}

img, video{
display: block;
max-width: 100%;
height: auto;
}

.flex {
display: flex !important;
}

.mx-2 {
margin-left: 0.5rem;
margin-right: 0.5rem;
}

var

创建src/styles/var.less,填入以下内容:

styles/var.less
@primaryColor: #2d8cf0;
@primaryColorHover: #57a3f3;
@header-height: 64px;
@footer-height: 70px;

index

创建src/styles/index.less,填入以下内容:

styles/index.less
@import 'transition/index.less';
@import './var.less';
@import './common.less';

引入样式

修改stc/App.vue,引入样式:

<style lang="less">
@import 'styles/index.less';
</style>