File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,12 @@ Use `v-effect` to execute **reactive** inline statements:
138
138
139
139
The effect uses ` count ` which is a reactive data source, so it will re-run whenever ` count ` changes.
140
140
141
+ Another example of replacing the ` todo-focus ` directive found in the original Vue TodoMVC example:
142
+
143
+ ``` html
144
+ <input v-effect =" if (todo === editedTodo) $el.focus()" />
145
+ ```
146
+
141
147
### Components
142
148
143
149
The concept of "Components" are different in ` petite-vue ` , as it is much more bare-bones.
@@ -303,7 +309,9 @@ Check out the [examples directory](https://github.com/vuejs/petite-vue/tree/main
303
309
304
310
### Has Different Behavior
305
311
306
- - Most expressions has access to its bound element as ` $el ` (except for structural directives like ` v-if ` and ` v-for ` )
312
+ - Most expressions (except for structural directives like ` v-if ` and ` v-for ` ) has access to the following magic properties:
313
+ - ` $el `
314
+ - ` $nextTick `
307
315
- ` createApp() ` (accepts global state instead of root component)
308
316
- Components
309
317
- Custom directives
You can’t perform that action at this time.
0 commit comments