Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dy authored Oct 7, 2024
1 parent de14a0d commit 7678319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ sprae.use({ compile })

* To prevent [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content) add `<style>[:each],[:if],[:else] {visibility: hidden}</style>`.
* Attributes order matters, eg. `<li :each="el in els" :text="el.name"></li>` is not the same as `<li :text="el.name" :each="el in els"></li>`.
* Watch out for self-closing tags, it's tempting to use `<a :text="item" />` but that's invalid html, it will create rendering errors.
* Be mindful of self-closing tags, eg. <a :text="item" /> is invalid HTML and will cause error. Main valid self-closing tags are `li`, `p`, `dt`, `dd`, `option`, `tr`, `td`, `th`.
* Properties prefixed with `_` are untracked: `let state = sprae(el, {_x:2}); state._x++; // no effect`.
* To destroy state and detach sprae handlers, call `element[Symbol.dispose]()`.
* State getters/setters work as computed effects, eg. `sprae(el, { x:1, get x2(){ return this.x * 2} })`.
Expand Down

0 comments on commit 7678319

Please sign in to comment.