/vuex

vuex 深入实践

Primary LanguageJavaScript

vuex

vuex 深入实践 vuex状态管理用法汇总

vuex主要概念

state

mutation

action

getter

module

namespace

复用和认证

vue-cli生成

vue.config.js

docs vue自定义模块

<docs></docs>

vue 全局组件

vue.component()

mock

模拟请求,实现vuex action promise异步更新state

SSR

vuex服务端渲染

页面平滑滚动

smoothScroll
util/index.js

自定义函数均分目标位置和当前位置距离,按照滑动时间,毫秒级移动实现平滑效果。

项目启动

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your tests

npm run test

Lints and fixes files

npm run lint