Skip to content

Commit 64829a4

Browse files
committed
readme
1 parent 6c2b3ba commit 64829a4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ Use `v-effect` to execute **reactive** inline statements:
138138

139139
The effect uses `count` which is a reactive data source, so it will re-run whenever `count` changes.
140140

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+
141147
### Components
142148

143149
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
303309

304310
### Has Different Behavior
305311

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`
307315
- `createApp()` (accepts global state instead of root component)
308316
- Components
309317
- Custom directives

0 commit comments

Comments
 (0)