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


边栏推荐
- [system design] proximity service
- golang7_TCP编程
- MySQL数据库:读写分离
- Koa2+better-sqlite3 to add, delete, change and query
- 微信小程序:万圣节头像框生成工具
- Shell——文本处理命令
- [high concurrency] 28000 words' summary of callable and future interview knowledge points. After reading it, I went directly to ByteDance. Forgive me for being a little drifting (Part 1)
- Online text filter less than specified length tool
- 丢弃 Tkinter!简单配置快速生成超酷炫 GUI!
- 投资人跌下神坛:半年0出手,转行送外卖
猜你喜欢

微信小程序:万圣节头像框生成工具

微信小程序:装B神器P图修改微信流量主小程序源码下载趣味恶搞图制作免服务器域名

Uncover the practice of Baidu intelligent test in the field of automatic test execution

高校女生穿旗袍答辩!网友:导师说论文要是和旗袍一样漂亮就好了

疯狂的数字藏品,下一个造富神话?

Koa2+better-sqlite3 to add, delete, change and query

go-zero微服务实战系列(七、请求量这么高该如何优化)

##Mondo Rescue制作镜像文件(有利于镜像损坏恢复)

揭秘百度智能测试在测试自动执行领域实践

中康控股开启招股:拟募资净额3.95亿港元,预计7月12日上市
随机推荐
golang代码规范整理
Goby full port scan
Introduction to reverse commissioning -pe file section table and block 03/07
Deecamp2022 officially opened! Likaifu and zhangyaqin personally teach master courses 𞓜 innovation
3d立体相册,情人节,情侣生日礼物代码适用
leetcode:226. 翻转二叉树
昨天面试居然聊了半个多小时的异常处理
Summary of binary tree exercises
灵感收集·创意写作软件评测:Flomo、Obsidian Memo、Napkin、FlowUs
How goby exports scan results
文物数字藏品,开启文化传承的新方式
现场快递柜状态采集与控制系统
Problems in replacing RESNET convolution of mmdet with ghost convolution group
嵌入式开发:硬件在环测试
微信小程序:全新独家云开发微群人脉
Wechat applet: new and exclusive cloud development wechat group contacts
urllib urllib2
留给比亚迪的时间还有三年
goby全端口扫描
MySQL数据库:使用show profile命令分析性能