【uni-app】uni-app使用vuex
1.在项目根目录下创建store文件夹,在文件夹下创建index.js2.在store/index.js文件夹引入vuex,并且定义相关属性和方法import Vuex from 'vuex'import Vue from 'vue'Vue.use(Vuex)export default new Vuex.Store({ // 全局属性变量 state: { num: 1, name: '苹果', price: 10, testList: [] }, // 全局同
原创
2020-11-09 23:26:14 ·
331 阅读 ·
0 评论