+
+ count: {{ counter.count }}
+
+
+
+
+
+
+```
+#### 4.变更
+用 store.count++ 直接改变 store,还可以调用 $patch 方法
+#### 5.替换
+不能完全替换掉 store 的 state,因为那样会破坏其响应性,还是使用patch
+
+### 四、Getter
+Getter 完全等同于 store 的 state 的计算属性
+
+```js
+export const useCountStore = defineStore('count',{
+ state:()=>{
+ return {count:1}
+ },
+ actions:{
+ onClick(){
+ this.count++
+ }
+ },
+ getters: {
+ doubleCount: (state) => state.count * 2,
+ },
+})
+```
+- 大多数时候,getter 仅依赖 state,不过,有时它们也可能会使用其他 getter,通过 this,你可以访问到其他任何 getter
+- getter 只是幕后的计算属性,所以不可以向它们传递任何参数。不过,你可以从 getter 返回一个函数,该函数可以接受任意参数
+
+```js
+export const useUsersStore = defineStore('users', {
+ getters: {
+ getUserById: (state) => {
+ // 可以返回函数,这个返回的函数可以接受容易参数
+ return (userId) => state.users.find((user) => user.id === userId)
+ },
+ },
+})
+ // 调用
+```
+
+### 五、Action
+Action 相当于组件中的方法,也可通过 this 访问整个 store 实例,而且是可以异步的
\ No newline at end of file
diff --git "a/\347\274\252\346\242\223\344\272\250/20240516-\345\244\215\344\271\240\344\273\243\347\240\201.md" "b/\347\274\252\346\242\223\344\272\250/20240516-\345\244\215\344\271\240\344\273\243\347\240\201.md"
new file mode 100644
index 0000000000000000000000000000000000000000..87ece2d1b83e546648743e2b9611cf4aedddb583
--- /dev/null
+++ "b/\347\274\252\346\242\223\344\272\250/20240516-\345\244\215\344\271\240\344\273\243\347\240\201.md"
@@ -0,0 +1,261 @@
+## app.vue
+
+```vue
+
+
+