Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Vue 实例选项


Vue 中的选项是指我们在使用选项式 API 时,在 Vue 实例上可用的不同选项。

选项 描述
data 包含我们设置的数据属性及其初始值
methods 包含我们编写的函数
computed 包含我们创建的计算属性,它们用作数据属性,但编写方式类似于带返回值且没有参数的函数,并且在任何依赖项发生变化时都会被调用
watch 包含我们创建的侦听器,它们类似于在具有相同名称的数据属性发生变化时被调用的函数
props 包含组件的属性,这些属性用作父组件的自定义属性
emits 包含组件的事件,即组件发出的自定义事件,用于其父组件
expose 包含公共属性列表。未公开的属性将对组件保持私有

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.