forked from JasonBai007/vue-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
127ff10
commit 74ee8c2
Showing
6 changed files
with
99 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,62 @@ | ||
import Mock from 'mockjs' | ||
import Mock from "mockjs"; | ||
let debug = 1; | ||
if (debug) { | ||
Mock.mock(/login/, { | ||
"data": { | ||
userId: "@integer(1,10)", | ||
"userName|1": ["鲁班七号", "后裔", "蔡文姬", "王昭君", "妲己", "铠"], | ||
token: '@string(30)' | ||
Mock.mock(/login/, { | ||
data: { | ||
userId: "@integer(1,10)", | ||
"userName|1": ["鲁班七号", "夏侯惇", "蔡文姬", "王昭君", "妲己"], | ||
token: "@string(30)" | ||
}, | ||
msg: "Success", | ||
status: "YQ-000" | ||
}); | ||
Mock.mock(/getMenu/, { | ||
data: { | ||
menu: [ | ||
{ | ||
name: "项目管理", | ||
name_en: "Projects", | ||
router: "/", | ||
icon: "el-icon-time", | ||
children: [ | ||
{ | ||
name: "开发备忘", | ||
name_en: "Notes", | ||
router: "/notes", | ||
icon: "el-icon-date" | ||
}, | ||
{ | ||
name: "关于作者", | ||
name_en: "About", | ||
router: "/about", | ||
icon: "el-icon-document" | ||
} | ||
] | ||
}, | ||
"msg": "Success", | ||
"status": "YQ-000" | ||
}) | ||
Mock.mock(/getMenu/, { | ||
"data": { | ||
menu: [{ | ||
name: '项目管理', | ||
name_en: 'Projects', | ||
router: '', | ||
icon: 'el-icon-time', | ||
children: [{ | ||
name: '开发备忘', | ||
name_en: 'Notes', | ||
router: '/project-info', | ||
icon: 'el-icon-date' | ||
}, { | ||
name: '关于作者', | ||
name_en: 'About', | ||
router: '/enroll-list', | ||
icon: 'el-icon-document' | ||
}] | ||
}, { | ||
name: '天气预报', | ||
name_en: 'Weather', | ||
router: '/weather', | ||
icon: 'el-icon-picture-outline', | ||
children: [] | ||
}, { | ||
name: '魔幻立方', | ||
name_en: 'Cube', | ||
router: '/cube', | ||
icon: 'el-icon-menu', | ||
children: [] | ||
}, { | ||
name: '权限测试', | ||
name_en: 'Authority', | ||
router: '/authority-test', | ||
icon: 'el-icon-setting', | ||
children: [] | ||
}] | ||
{ | ||
name: "天气预报", | ||
name_en: "Weather", | ||
router: "/weather", | ||
icon: "el-icon-picture-outline", | ||
children: [] | ||
}, | ||
"msg": "Success", | ||
"status": "YQ-000" | ||
}) | ||
} | ||
{ | ||
name: "魔幻立方", | ||
name_en: "Cube", | ||
router: "/cube", | ||
icon: "el-icon-menu", | ||
children: [] | ||
}, | ||
{ | ||
name: "权限测试", | ||
name_en: "Authority", | ||
router: "/authority", | ||
icon: "el-icon-setting", | ||
children: [] | ||
} | ||
] | ||
}, | ||
msg: "Success", | ||
status: "YQ-000" | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,48 @@ | ||
<template> | ||
<div v-title="'项目信息'"> | ||
<el-card class="box-card"> | ||
<div slot="header" class="clearfix"> | ||
<i class="el-icon-edit"></i> | ||
<span>Vue开发备忘录</span> | ||
</div> | ||
<div class="text item"> | ||
<ol> | ||
<li v-for="(str,index) in notes" :key="index">{{str}}</li> | ||
</ol> | ||
</div> | ||
</el-card> | ||
|
||
</div> | ||
<div v-title="'项目信息'"> | ||
<el-card class="box-card"> | ||
<div slot="header" class="clearfix"> | ||
<i class="el-icon-edit"></i> | ||
<span>Vue开发备忘录</span> | ||
</div> | ||
<div class="text item"> | ||
<ol> | ||
<li v-for="(str,index) in notes" :key="index">{{str}}</li> | ||
</ol> | ||
</div> | ||
</el-card> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
name: "projectinfo", | ||
data() { | ||
return { | ||
notes: [ | ||
'Axios不支持JSONP,需要另外安装jsonp模块实现', | ||
'如果需要动态生成路由,可以使用router.addRoutes(routes)', | ||
'如果要区分新建页和编辑页,可以在路由对象中设置meta属性', | ||
'在组件中访问路由信息对象:this.$route', | ||
'在组件中访问路由实例:this.$router', | ||
'可以在全局拦截路由,也可以在单个组件中拦截路由', | ||
'如果是中等规模的项目,推荐使用vuex', | ||
'代码按页面分,每个人负责一个页面,尽量避免公共代码文件', | ||
'如果想看其它队友的页面效果,可以在本地新建一个分支,然后将自己和对方的分支合并上去', | ||
'深度监听一个对象非常消耗性能,可以转换成监听一个开关变量,开关一变就运行', | ||
'渲染图表时,可以在渲染前先 this.myChart.dispose(),销毁上次的图表', | ||
'vue-particles打包报错:https://github.com/creotip/vue-particles/issues/7', | ||
'配置favicon:https://segmentfault.com/a/1190000010043013#articleHeader5', | ||
'切换路由时,vuex里的state不会跟着变,除非在导航守卫里提交mutations', | ||
] | ||
notes: [ | ||
"Axios不支持JSONP,需要另外安装jsonp模块实现", | ||
"如果需要动态生成路由,可以使用router.addRoutes(routes)", | ||
"如果要区分新建页和编辑页,可以在路由对象中设置meta属性", | ||
"在组件中访问路由信息对象:this.$route", | ||
"在组件中访问路由实例:this.$router", | ||
"可以在全局拦截路由,也可以在单个组件中拦截路由", | ||
"如果是中等规模的项目,推荐使用vuex", | ||
"代码按页面分,每个人负责一个页面,尽量避免公共代码文件", | ||
"如果想看其它队友的页面效果,可以在本地新建一个分支,然后将自己和对方的分支合并上去", | ||
"深度监听一个对象非常消耗性能,可以转换成监听一个开关变量,开关一变就运行", | ||
"渲染图表时,可以在渲染前先 this.myChart.dispose(),销毁上次的图表", | ||
"vue-particles打包报错:https://github.com/creotip/vue-particles/issues/7", | ||
"配置favicon:https://segmentfault.com/a/1190000010043013#articleHeader5", | ||
"切换路由时,vuex里的state不会跟着变,除非在导航守卫里提交mutations" | ||
] | ||
}; | ||
} | ||
}; | ||
</script> | ||
<style scoped lang="scss"> | ||
li { | ||
ol { | ||
margin-top: 0; | ||
li { | ||
line-height: 30px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters