File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -210,3 +210,26 @@ isReactive(foo.value) // false
210
210
```
211
211
212
212
** See also** : [ Creating Standalone Reactive Values as ` refs ` ] ( ../guide/reactivity-fundamentals.html#creating-standalone-reactive-values-as-refs )
213
+
214
+ ## ` triggerRef `
215
+
216
+ Execute any effects tied to a [ ` shallowRef ` ] ( #shallowref ) manually.
217
+
218
+ ``` js
219
+ const shallow = shallowRef ({
220
+ greet: ' Hello, world'
221
+ })
222
+
223
+ // Logs "Hello, world" once for the first run-through
224
+ watchEffect (() => {
225
+ console .log (shallow .value .greet )
226
+ })
227
+
228
+ // This won't trigger the effect because the ref is shallow
229
+ shallow .value .greet = ' Hello, universe'
230
+
231
+ // Logs "Hello, universe"
232
+ triggerRef (shallow)
233
+ ```
234
+
235
+ ** See also:** [ Computed and Watch - watchEffect] ( ./computed-watch-api.html#watcheffect )
You can’t perform that action at this time.
0 commit comments