We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
主要用于监听数据发生变化,可以监听的来源有props、data、computed。 watch方法接受2个参数(newValue,oldValue),第一个参数是发生变化后的值,第二个参数是发生变化前的值
computed主要是存储一些需要数据处理的值,其实和data比较像,也可以理解为在data的基础上做一些额外的数据处理操作,并且返回一个新的变量。 假设computed方法内使用了data的变量,当data变量发生改变后,则会触发当前computed变量进行重新计算
The text was updated successfully, but these errors were encountered:
No branches or pull requests
watch监听属性
主要用于监听数据发生变化,可以监听的来源有props、data、computed。
watch方法接受2个参数(newValue,oldValue),第一个参数是发生变化后的值,第二个参数是发生变化前的值
computed计算属性
computed主要是存储一些需要数据处理的值,其实和data比较像,也可以理解为在data的基础上做一些额外的数据处理操作,并且返回一个新的变量。
假设computed方法内使用了data的变量,当data变量发生改变后,则会触发当前computed变量进行重新计算
The text was updated successfully, but these errors were encountered: