-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] v-once的使用场景有哪些? #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
vue
vue
Comments
单次触发的场景 |
表单提交。可防止用户在请求未及时响应时,多次提交~ |
那假如触发了验证,验证失败了需要重新提交呢 |
v-once 只渲染元素和组件一次。随后的重新渲染,元素/组件及其所有的子节点将被视为静态内容并跳过。这可以用于优化更新性能。 |
当页面需要显示一个元素的首次渲染的初始值以及在这之后变化后的值时,可以对首次渲染的标签使用v-once {{msg}} //msg不会改变{{msg}} |
只渲染一次,不会随着数据改变而改变 |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[vue] v-once的使用场景有哪些?
The text was updated successfully, but these errors were encountered: