当前位置:网站首页>[use of veux developer tools - use of getters]
[use of veux developer tools - use of getters]
2022-06-29 14:05:00 【Brave * Niuniu】
Basic use

Initialization data 、 To configure
actions、 To configuremutations, Operation filestore.js// introduce Vue Core library import Vue from 'vue' // introduce Vuex import Vuex from 'vuex' // quote Vuex Vue.use(Vuex) const actions = { // Respond to the actions added in the component jia(context,value){ // console.log('actions Medium jia Is called the ',miniStore,value) context.commit('JIA',value) }, } const mutations = { // Executive plus JIA(state,value){ // console.log('mutations Medium JIA Is called the ',state,value) state.sum += value } } // Initialization data const state = { sum:0 } // Create and expose store export default new Vuex.Store({ actions, mutations, state, })Read... In component vuex Data in :
$store.state.sumComponent vuex Data in :
$store.dispatch('action Method name in ', data )or$store.commit('mutations Method name in ', data )remarks : If there is no network request or other business logic , Components can also cross actions, Not to write
dispatch, Direct writingcommit


边栏推荐
- Navicat连接MySQL8.0的正确方法(亲测有效)
- 在同花顺上开户安全吗 开户在哪里申请
- Open source machine learning platform
- 节点数据采集和标签信息的远程洪泛传输
- 瑞达期货可以开户吗?安全可靠吗?
- golang6 反射
- 硬件开发笔记(八): 硬件开发基本流程,制作一个USB转RS232的模块(七):创建基础DIP元器件(晶振)封装并关联原理图元器件
- 手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学
- 在线文本过滤小于指定长度工具
- Problems in replacing RESNET convolution of mmdet with ghost convolution group
猜你喜欢
随机推荐
【烹饪记录】--- 酸辣白菜
微信小程序:装B神器P图修改微信流量主小程序源码下载趣味恶搞图制作免服务器域名
urllib urllib2
Matlab fmincon precision, fmincon and quadprog error
Prometheus 2.28.0 new features
C keyboard hook
靠代理,靠买断,国产端游的蛮荒时代等待下一个《永劫无间》
微信小程序:修复采集接口版云开发表情包
Getting started with SQLite3
动荡的中介生意,不安的租房人
28000 word summary of callable and future interview knowledge points. After reading it, I went directly to ByteDance. Forgive me for being a little floating (Part 2)
Seekg() [easy to understand]
##Mondo Rescue制作镜像文件(有利于镜像损坏恢复)
微信小程序:全新独家云开发微群人脉
c语言入门教程–-6循环语句
Industry analysis - quick intercom, building intercom
systemd调试
Detailed explanation of PDB symbol library files
urllib urllib2
投资人跌下神坛:半年0出手,转行送外卖









