技术栈:

vue2 vuex vue-router axios webpack eslint better-scroll

1.安装插件

npm install vue-resource babel-runtime --save

 

npm install babel-preset-es2015 stylus-loader function-bind json-loader --save-dev

2.增加 better-scroll

.eslintrc.js

'space-before-function-paren': 0,
'semi': 0,
'no-new': 0,
'no-unused-vars': 0,
'no-undef': 0

安装插件:

npm install better-scroll fastclick iscroll v-tap vue-scroll --save

3.添加 axios

 

4.添加 vuex

 

5.打包 

npm run build

 

.gitignore

.DS_Store
node_modules/
resource/
dist/
npm-debug.log

6.

npm install moment --save

制作时间过滤器,将 时间戳 变为 日期格式

 

7.设置mock 数据

build/dev-server.js

var appData = require('../static/data.json')

8.

npm install eslint-config-standard --save

9.

npm install watchpack --save

注:下面是关于这些钩子函数的解释:

hook 描述
beforeCreate 组件实例刚被创建,组件属性计算之前
created 组件实例创建完成,属性已绑定,但是 DOM 还未生成, $el 属性还不存在
beforeMount 模板编译/挂载之前
mounted 模板编译/挂载之后
mounted 模板编译/挂载之后(不保证组件已在 document 中)
beforeUpdate 组件更新之前
updated 组件更新之后
activated for keep-alive,组件被激活时调用
deactivated for keep-alive,组件被移除时调用
beforeDestory 组件销毁前调用
destoryed 组件销毁后调用

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-11-30
  • 2021-12-02
  • 2021-08-31
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2022-12-23
  • 2022-01-25
  • 2021-11-13
  • 2021-05-04
  • 2021-07-15
  • 2021-09-10
相关资源
相似解决方案