]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: links
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 15 May 2024 14:35:53 +0000 (16:35 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 15 May 2024 14:35:53 +0000 (16:35 +0200)
packages/docs/cookbook/composables.md
packages/docs/cookbook/testing.md
packages/docs/zh/cookbook/composables.md
packages/docs/zh/cookbook/testing.md

index 45cb717b3fa83460b4c0bdbf333e3367cd68d8b7..1f65952f1486af140a14b1fee184ee4705fea0d7 100644 (file)
@@ -4,6 +4,11 @@
 
 ## Option Stores
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/using-composables-in-option-stores"
+  title="Using Composables in Option Stores"
+/>
+
 When defining an option store, you can call a composable inside of the `state` property:
 
 ```ts
@@ -27,6 +32,11 @@ Here are some examples of composables that cannot be used in an option stores (b
 
 ## Setup Stores
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/using-composables-in-setup-stores"
+  title="Using Composables in Setup Stores"
+/>
+
 On the other hand, when defining a setup store, you can use almost any composable since every property gets discerned into state, action, or getter:
 
 ```ts
index 4a153e8a46f7b9ac584d11ede76d032a32765428..74b6159a218efde76858db9eddd4fc26db30d948 100644 (file)
@@ -1,5 +1,10 @@
 # Testing stores
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/introduction-to-testing-stores"
+  title="Learn how to test stores"
+/>
+
 Stores will, by design, be used at many places and can make testing much harder than it should be. Fortunately, this doesn't have to be the case. We need to take care of three things when testing stores:
 
 - The `pinia` instance: Stores cannot work without it
index 5c78efdd762aa94d6724156c247060841deb771b..bc09d418b2973b7eb2603546eab9881b72fdbdda 100644 (file)
@@ -4,6 +4,11 @@
 
 ## Option Stores %{#option-stores}%
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/using-composables-in-option-stores"
+  title="Using Composables in Option Stores"
+/>
+
 当定义一个 option store 时,你可以在 `state` 属性中调用组合式函数:
 
 ```ts
@@ -27,6 +32,11 @@ export const useAuthStore = defineStore('auth', {
 
 ## Setup Stores %{#setup-stores}%
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/using-composables-in-setup-stores"
+  title="Using Composables in Setup Stores"
+/>
+
 另外,当定义一个 setup store 时,你几乎可以使用任何组合式函数,因为每一个属性都会被辨别为 state 、action 或者 getter:
 
 ```ts
index b92e9df5356bba9b27b50fd9ec2b70306d4b38ec..cd5450f7586bf5872eefee2a2b8fa804be6307a8 100644 (file)
@@ -1,5 +1,10 @@
 # store 测试 %{#testing-stores}%
 
+<MasteringPiniaLink
+  href="https://masteringpinia.com/lessons/introduction-to-testing-stores"
+  title="Learn how to test stores"
+/>
+
 从设计上来说,许多地方都会使用 store,所以可能比正常情况更难测试。但幸运的是,这不一定是真的。在测试 store 时,我们需要注意三件事:
 
 - `pinia` 实例:没有它,store 不能正常工作