摘要: 参考 js文件(store.js) import Vue from "vue" export let store = Vue.observable({ count: 3, name: "栗子" }) export let mutations = { setCount(count) { store.c 阅读全文
posted @ 2020-08-04 10:49 文件传输助手01 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 响应式的数组方法 阅读全文
posted @ 2020-08-03 18:59 文件传输助手01 阅读(99) 评论(0) 推荐(0) 编辑
摘要: ajax的缓存机制 只要是URL相同的GET请求,浏览器会使用缓存(当然还要看服务器的Cache-Control/Expires/Last-Modified/ETag头的设置)。 只要是POST请求,浏览器都不会缓存。 Https的请求,浏览器不会缓存(绝大数情况如此,但是也有例外,据说FF浏览器是 阅读全文
posted @ 2020-08-03 15:56 文件传输助手01 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 理解 1.Vuex 的状态存储是响应式的。当 Vue 组件从 store 中读取状态的时候,若 store 中的状态发生变化,那么相应的组件也会相应地得到高效更新。 2.不能直接改变 store 中的状态。改变 store 中的状态的唯一途径就是显式地提交 commit/mutation。 acti 阅读全文
posted @ 2020-08-03 10:11 文件传输助手01 阅读(117) 评论(0) 推荐(0) 编辑
摘要: keep-alive 阅读全文
posted @ 2020-07-29 17:01 文件传输助手01 阅读(80) 评论(0) 推荐(0) 编辑
摘要: scrollBehavior history 模式适用 to/from 路由对象 savedPosition 当通过浏览器的 前进/后退 触发 const router = new VueRouter({ routes: [...], scrollBehavior (to, from, savedP 阅读全文
posted @ 2020-07-29 15:33 文件传输助手01 阅读(501) 评论(0) 推荐(0) 编辑
摘要: vue.use()和vue.install() vue组件直接执行vue.use(xxx) 组件本身执行了vue.intsall 自定义组件函数等 先执行vue.install() 再执行vue.use() $nextTick 在`数据变化后`要执行的某个操作,而这个操作需要`使用随数据改变而改变的 阅读全文
posted @ 2020-07-24 16:49 文件传输助手01 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 路由传递的方式 query(类似get传参,参数在地址栏) this.$router.push({name:"xxx",query:{type:"xxx"}}) params(类似post传参) this.$router.push({path:"xxx",params:{type:"xxx"}}) 阅读全文
posted @ 2020-07-24 15:21 文件传输助手01 阅读(222) 评论(0) 推荐(0) 编辑
摘要: $attrs和$listeners 爷孙组件传值 情景 A组件内部嵌套B组件,B组件内部嵌套C组件 A组件代码 <div class="grand"> {{count}}父组件 {{msg}}父组件 <child2 :count="count" :msg="msg" @handleCount="ha 阅读全文
posted @ 2020-07-23 11:46 文件传输助手01 阅读(249) 评论(0) 推荐(0) 编辑
摘要: v-model v-model的本质是 :value和@input="test=$event.target.value"的语法糖 修饰符 v-model.lazy 事件触发后将输入框的值与数据进行同步 添加lazy 转变为与change事件同步(焦点移除时触发) v-model.trim 去除字符串 阅读全文
posted @ 2020-07-23 10:04 文件传输助手01 阅读(167) 评论(0) 推荐(0) 编辑