摘要: 1,引入vuex import { createStore } from "vuex"; 2,创建store const store = createStore({ state(){ return { count: 1, } } mutations: { add(state){ state.coun 阅读全文
posted @ 2021-07-04 23:09 周十发 阅读(312) 评论(0) 推荐(0)
摘要: 组件watch选项和实例方法$watch不再支持点分隔符字符串路径 以,分隔的表达式不再被watch和$watch支持,可以使用计算函数作为$watch参数实现。 1,vue3同时监听多个参数执行相同的方法 watch([() => book.name, count], ([name, count] 阅读全文
posted @ 2021-07-04 22:09 周十发 阅读(115) 评论(0) 推荐(0)
摘要: 1,v-enter -> v-enter-from 2,v-leave -> v-leave-from 相对应的就是 v-enter-from + v-enter-to -> v-enter-active v-leave-from + v-leave-to -> v-leave-active <te 阅读全文
posted @ 2021-07-04 21:51 周十发 阅读(509) 评论(0) 推荐(0)
摘要: bind -> beforeMount 组件挂载之前 inserted -> mounted beforeUpdate 元素自身更新前调用,和组件生命周期钩子很像(更新前用) componentUpdate -> updated(更新后用) beforeUnmount 和生命周期相似,元素将要被调用 阅读全文
posted @ 2021-07-04 21:27 周十发 阅读(165) 评论(0) 推荐(0)
摘要: 一,vue3路由跳转 1,引入vue-router import { useRouter } from 'vue-router'; 2,steup中定义方法push,replace等等 const { push, replace} = useRouter(); 二,vue3路由url传参 1,用pu 阅读全文
posted @ 2021-07-04 12:36 周十发 阅读(1517) 评论(0) 推荐(0)