{{ counter }} {{ doubleCount }}
用户名:{{username}}
``` ## 7、通过actions修改状态 ### 7.1 传参修改状态username ```js function changeName(params) { userStore.resetName(params.target.value) } ``` ### 7.2 直接修改 ```js function changeName(params) { userStore.username = params.target.value } ``` ### 7.3 批量修改状态 ```js userStore.$patch( state =>{ state.age = 30 state.username = 'Lisi' }) ```