docs: add note for useState usage (#1901)

This commit is contained in:
webfansplz 2021-11-15 18:30:38 +08:00 committed by GitHub
parent f298386795
commit 1a8fc3dd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,10 @@ Within your pages, components and plugins you can use `useState`. It can be used
You can think of it as an SSR-friendly ref in that its value will be hydrated (preserved) after server-side rendering. It is shared across all components. You can think of it as an SSR-friendly ref in that its value will be hydrated (preserved) after server-side rendering. It is shared across all components.
::alert{icon=👉}
**`useState` only works during `setup` or `Lifecycle Hooks`**
::
### Usage ### Usage
```js ```js