1. 只读的全局变量 对于只读的全局变量,知道的有以下两种使用方式: 1)global.js 模块中定义:其他模块import后再使用即可 1.1)定义 import Vue from 'vue'; let MyComm = new Vue({ methods: { deleteCookie: function (cname) { let d = new Date(); let expires = "expires=" + d.toGMTString(); document.cooki
https://juejin.im/post/5cd50849f265da03a54c3877 在 vue 中,通信有几种形式: 父子组件 emit/on vuex 中共享 state 跨组件 EventBus 文档中的提到的 Store 模式却鲜有人去使用讨论.笔者在研究 ElementUI的Table组件的代码组织方式,以及在自己 ElementUI 表单编辑项目中实践之后觉得其在复杂组件组织上非常有用,是一个被忽视的组件通信方法. 简单状态管理 store 模式 官方示例代码: var s
报错 :Vuex - Computed property “name” was assigned to but it has no setter 如何解决: computed: { addModal: { get: function () { return this.$store.state.addModal }, set: function (newValue) { this.$store.state.addModal = newValue } } }, 设置一个set