网络编程
位置:首页>> 网络编程>> JavaScript>> vue-cli整合vuex的时候,修改actions和mutations,实现热部署的方法

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

作者:BeArchitect  发布时间:2024-05-13 09:13:16 

标签:vue-cli,vuex,actions,mutations

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


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

来源:https://blog.csdn.net/s8460049/article/details/53812199

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com