摘要:
vue-router vue-resource vuex 阅读全文
摘要:
export default vuex.Store{ State, //数据库。 getters,// 是我们从数据库里取数据的 API,getters 得是一个”纯函数“ actions,//处理数据 Mutations, //把数据存入数据库的 API,用来修改state 的。 } getters: // 获取控制变量 ctrl export function g... 阅读全文
摘要:
单个路由的过渡 基于路由的动态过渡 阅读全文
摘要:
//meta字段,一个路由匹配到的所有路由记录会暴露为 $route 对象(还有在导航守卫中的路有对象)的 $route.matched 数组。 const router = new VueRouter({ routes: [ { path: '/foo', component: Foo, children: [ { ... 阅读全文
摘要:
导航守卫主要用来通过跳转或取消的方式守卫导航 全局守卫,使用 router.beforeEach 注册一个全局前置守卫 const router = new VueRouter({ ... }) router.beforeEach((to, from, next) => { // to: Route 阅读全文
摘要:
vue-router 默认 hash 模式,页面不会重新加载 用路由的 history 模式,利用 history.pushState API 来完成 URL 跳转而无须重新加载页面。 需要服务端支持,服务端增加一个覆盖所有情况的候选资源:如果 URL 匹配不到任何静态资源,则应该返回同一个 ind 阅读全文
摘要:
在组件中使用$route会使之与其对应路由形成高度耦合,使用props解耦 阅读全文