当前位置:网站首页>[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


边栏推荐
- OpenSSL certificate tool user manual
- MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
- Getting started with SQLite3
- 【云驻共创】通过Rust语言计算加速技术突破图片识别性能瓶颈
- 投资人跌下神坛:半年0出手,转行送外卖
- Koa2+better-sqlite3 to add, delete, change and query
- golang7_TCP编程
- MySQL数据库:使用show profile命令分析性能
- Wechat applet: install B artifact and P diagram, modify wechat traffic main applet source code, Download funny joke diagram, make server free domain name
- 文物数字藏品,开启文化传承的新方式
猜你喜欢

【云驻共创】通过Rust语言计算加速技术突破图片识别性能瓶颈

Application of ansvc reactive power compensation device in a shopping mall in Hebei

Online text filter less than specified length tool

Wechat applet: Yunkai publishes white wall wechat applet source code download server free and domain name support traffic main revenue

Xiaobai learns MySQL - incremental statistical SQL requirements - windowing function scheme
![[system design] proximity service](/img/3b/b0dbd25945f9c914b097140890d8f9.png)
[system design] proximity service

I talked about exception handling for more than half an hour during the interview yesterday

Wechat applet: repair collection interface version cloud development expression package

现场快递柜状态采集与控制系统

Unity SplashImage 缩放问题
随机推荐
MySQL数据库:存储引擎
How goby exports scan results
Online text filter less than specified length tool
微信小程序:(更新)云开发微群人脉
Xiaobai learns MySQL - incremental statistical SQL requirements - windowing function scheme
Detailed explanation of PDB symbol library files
在同花顺上开户安全吗 开户在哪里申请
内网穿透(nc)
文物数字藏品,开启文化传承的新方式
节点数据采集和标签信息的远程洪泛传输
Interview high concurrent, cool!! (high energy in the whole process, collection recommended)
Follow me study hcie big data mining Chapter 1 Introduction to data mining module 1
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)
【毕业季·进击的技术er】1076万毕业生,史上最难就业季?卷又卷不过,躺又躺不平,敢问路在何方?
urllib urllib2
动荡的中介生意,不安的租房人
golang6 反射
微信小程序:装B神器P图修改微信流量主小程序源码下载趣味恶搞图制作免服务器域名
Applet Wechat: un nouveau réseau exclusif de microgroupes de développement de Cloud
Uncover the practice of Baidu intelligent test in the field of automatic test execution