AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] # vuex使用 1.安装 vuex 依赖包 ~~~ npm install vuex --save ~~~ 2.导入vuex包 ~~~ import Vuex from 'vuex' Vue.use (Vuex) ~~~ 3.创建store对象 ~~~ const store = new Vuex.store({ // state 中存放的就是全局共享的数据 state: { count: 0 } }) ~~~ 4.将store对象挂载到vue实例中 ~~~ new Vue ({ el: '#app', render: h => h(app) , router, // 将创建的共享 数据对象,挂载到Vue实例中 // 所有的组件, 就可以直接从store中获取全局的数据 了 store }) ~~~ # vue 可视化下载插件 1、vue ui 打开vue可视化插件 2、在创建项目的 Features > Babel、vuex、Linter/ Formatter、Use config files 4个