You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export let store =Vue.observable({count:0,name:'张三'});
export let mutations={
setCount(count){
store.count=count;
},
setName(name){
store.name=name;
}
}
Activity
dengBox commentedon Jun 28, 2019
类轻量级vuex,用作状态管理。
girlfighting commentedon Jul 5, 2019
vue2.6发布一个新的API,可以处理一些简单的跨组件共享数据状态的问题。
HeMin0919 commentedon Jul 23, 2019
//store.js
import Vue from 'vue';
export let store =Vue.observable({count:0,name:'张三'});
export let mutations={
setCount(count){
store.count=count;
},
setName(name){
store.name=name;
}
}
censek commentedon Oct 12, 2019
让一个对象可响应。Vue 内部会用它来处理 data 函数返回的对象。
返回的对象可以直接用于渲染函数和计算属性内,并且会在发生改变时触发相应的更新;也可以作为最小化的跨组件状态存储器。