Skip to content

Commit 10e8482

Browse files
committed
feat: 增加注释
1 parent 424521d commit 10e8482

File tree

4 files changed

+253
-223
lines changed

4 files changed

+253
-223
lines changed

src/App.vue

+26-22
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
<template>
2-
<div id="app">
3-
<Layout>
4-
<router-view/>
5-
</Layout>
6-
</div>
2+
<div id="app">
3+
<Layout>
4+
<router-view />
5+
</Layout>
6+
</div>
77
</template>
88

99
<script>
10-
import Layout from "@/layouts";
11-
export default {
12-
name: "App",
13-
components: {
14-
Layout
15-
}
16-
};
10+
import Layout from "@/layouts"; //最外层布局(类似Header、Footer等常驻页面的UI都放在这里)
11+
12+
export default {
13+
name: "App",
14+
components: {
15+
Layout,
16+
},
17+
};
1718
</script>
1819

1920
<style lang="scss">
20-
@import "./style/normalize.scss";
21-
@import "./style/reset.scss";
22-
@import "./style/common.scss";
23-
@import "~@/assets/iconfont/iconfont.css";
24-
#app {
25-
font-size: $font-size-base;
26-
color: $color-common;
27-
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF UI Text",
28-
"Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
29-
}
21+
// 重置浏览器样式
22+
@import "./style/normalize.scss";
23+
@import "./style/reset.scss";
24+
// 公用css、scss变量
25+
@import "./style/common.scss";
26+
// iconfont图标库(只做引入示例,项目不需要可以去掉)
27+
@import "~@/assets/iconfont/iconfont.css";
28+
#app {
29+
font-size: $font-size-base;
30+
color: $color-common;
31+
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF UI Text",
32+
"Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
33+
}
3034
</style>

src/main.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import Vue from 'vue'
22
import App from './App.vue'
3-
import router from './router'
4-
import store from './store'
5-
import i18n from './locale'
6-
import filters from './filters'
3+
import router from './router' // vue-router配置
4+
import store from './store' // vuex配置
5+
import i18n from './locale' // 国际化配置
6+
import filters from './filters' // vue过滤器
77

8+
// 自定义的toast(这里仅做示例,需自己根据需求变动)
89
import Toast from './components/toast/index'
910
Vue.use(Toast);
1011

src/router/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ const router = new Router({
4949
});
5050

5151
router.beforeEach((to, from, next) => {
52-
// 做些什么,通常权限控制就在这里做哦
52+
// 做些什么,通常权限控制就在这里做。
5353

54-
// 必须写next()哦,不然你的页面就会白白的,而且不报错,俗称"代码下毒"
54+
// 这里必须写next(),否则页面会阻止下一步操作。
5555
next();
5656
});
5757

0 commit comments

Comments
 (0)