摘要: let 和 const let 是块级作用域 let 声明的变量只在其所在的作用域内生效 之前在做保存局部变量的时候,都是通过闭包将当前的变量保存到就近的作用域链中。而使用 let 就不用了,let 声明的变量只在比如 console.log(a); //undefined console.log( 阅读全文
posted @ 2019-10-17 16:03 月山 阅读(549) 评论(0) 推荐(0) 编辑
摘要: ![](https://raw.githubusercontent.com/easterCat/img-package/master/img/Date.png) 阅读全文
posted @ 2019-10-17 16:01 月山 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 1.你有使用过 vuex 的 module 吗?主要是在什么场景下使用? 把状态全部集中在状态树上,非常难以维护。 按模块分成多个 module,状态树延伸多个分支,模块的状态内聚,主枝干放全局共享状态 2.vuex 中 actions 和 mutations 有什么区别? action actio 阅读全文
posted @ 2019-10-17 10:50 月山 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 1.vue router 怎么重定向页面? 路由中配置 redirect 属性 使用路由的别名来完成重定向 2.vue router 怎么配置 404 页面? ,放在最后一个 3.切换路由时,需要保存草稿的功能,怎么实现呢? beforeDe beforeRouteLeave 4.vue route 阅读全文
posted @ 2019-10-17 10:42 月山 阅读(406) 评论(0) 推荐(0) 编辑