首页 > 编程 > JavaScript > 正文

vue-cli整合vuex的时候,修改actions和mutations,实现热部署的方法

2019-11-19 12:54:24
字体:
来源:转载
供稿:网友

在store.js里面添加如下的代码就可以了:

// 热重载if (module.hot) { // 指定要监控的文件 module.hot.accept(['./mutations'], () => { const mutations = require('./mutations').default // Vuex 提供的热重载接口 store.hotUpdate({  mutations }) })}

以上这篇vue-cli整合vuex的时候,修改actions和mutations,实现热部署的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持武林网。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表