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


边栏推荐
- urllib urllib2
- Want to make a wechat game for answering questions? Reading this article is enough
- win11怎么看cpu几核几线程? win11查看cpu是几核几线程的教程
- Follow me study hcie big data mining Chapter 1 Introduction to data mining module 1
- Cloud native (31) | kubernetes chapter kubernetes platform basic pre installed resources
- grep 精确匹配
- 微信小程序:(更新)云开发微群人脉
- OpenSSL certificate tool user manual
- GBase8s数据库遇到951错误是什么原因?
- MySQL数据库:使用show profile命令分析性能
猜你喜欢

Summary of binary tree exercises

【黑马早报】中公教育市值蒸发逾2000亿;新东方直播粉丝破2000万;HM关闭中国首店;万科郁亮称房地产已触底;微信上线“大爆炸”功能...

手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学

Online text filter less than specified length tool

“死掉”的诺基亚,一年躺赚1500亿

微信小程序:云开发表白墙微信小程序源码下载免服务器和域名支持流量主收益

Lecun published a research plan for the next decade: AI autonomous intelligence with a 62 page paper

靠代理,靠买断,国产端游的蛮荒时代等待下一个《永劫无间》

Leetcode question brushing: String 07 (repeated substring)
![[graduation season · advanced technology Er] 10.76 million graduates, the most difficult employment season in history? I can't roll it up again. I lie down again and again. Where is the road?](/img/d5/7e093b898807b96b89bbe74174990b.png)
[graduation season · advanced technology Er] 10.76 million graduates, the most difficult employment season in history? I can't roll it up again. I lie down again and again. Where is the road?
随机推荐
go-zero微服务实战系列(七、请求量这么高该如何优化)
投资人跌下神坛:半年0出手,转行送外卖
从Mpx资源构建优化看splitChunks代码分割
微信小程序:(更新)云开发微群人脉
Installation and removal of cover for CPU protection on desktop motherboard
Introduction to reverse commissioning -pe file section table and block 03/07
内网穿透(nc)
Introduction to esp8266: three programming methods "suggestions collection"
揭秘百度智能测试在测试自动执行领域实践
MySQL数据库:读写分离
MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
Uncover the practice of Baidu intelligent test in the field of automatic test execution
Detailed explanation of PDB symbol library files
Deecamp2022 officially opened! Likaifu and zhangyaqin personally teach master courses 𞓜 innovation
MySQL数据库:drop、truncate、delete的区别
[high concurrency] cache idea
深度学习的坎坷六十年
Hardware development notes (VIII): basic process of hardware development, making a USB to RS232 module (VII): creating a basic dip component (crystal oscillator) package and associating the principle
golang7_TCP编程
MySQL数据库:使用show profile命令分析性能