//store 中  store.js
import Vue from 'vue'
import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({
state: {
author: 'Youngmon'
},
mutations: {
author(state, newName) {
state.author = newName;
}
},
actions: { }
}) export default store /**
//main.js 新增
import store from './store'
Vue.prototype.$store = store //demo.vue
this.$store.commit("author","yongmao"); computed: {
author() {
return this.$store.state.author
}
} */

最新文章

  1. 使用复合设计模式扩展持久化的CURD,Select能力
  2. PHP中的回调函数和匿名函数
  3. paip.自适应网页设计 跟 响应式 设计的区别跟原理and实践总结
  4. AndroidStudio支持新的NDK的操作使用
  5. OpenFileDialog组件打开文件....待续
  6. SQL Server tables export/import with bcp
  7. 我理解的javascript单线程机制
  8. 纯css3实现tab选项卡
  9. android4.0下载问题
  10. mybatis 自动生成代码(mybatis generator)
  11. [java语言]——InetAddress类的getByName()方法
  12. 团队作业7——第二次项目冲刺(Beta版本)
  13. 解决git反复输入密码的问题
  14. DOSBOX的安装和使用(window10 64位)
  15. 《锋利的jQuery》笔记:插件的使用和写法
  16. BGP 优选短的AS号路径实践总结
  17. Spark安装与介绍
  18. Maven支撑下的War应用依赖另外一个WAR应用的解决方案
  19. APP-4-百度地图定位
  20. Python高级知识点总结

热门文章

  1. 一款有意思的 Qt 飞行仪表控件
  2. 优秀开源项目之四:CrashRptProbe,查询程序奔溃的利器
  3. [Swift]UIAlertController 以及 Swift 中的闭包和枚举
  4. crossplatform---Nodejs in Visual Studio Code 01.简单介绍Nodejs
  5. 使用 install.packages() 安装所需的包
  6. 圆周卷积(circular convolution)
  7. Matlab随笔之分段线性函数化为线性规划
  8. eclipse 配置maven tomcat 环境
  9. VS发布到IIS Express外网Debug(如微信开发)
  10. JS顶级对象window