Skip to content

Update reactivity.md #697

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

Merged
merged 3 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/v2/guide/reactivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var vm = new Vue({
vm.message = 'Hello!'
```

如果你在 data 选项中未声明 `message`,Vue 将警告你渲染函数在试图访问的属性不存在
如果你未在 data 选项中声明 `message`,Vue 将警告你渲染函数正在试图访问的属性不存在

这样的限制在背后是有其技术原因的,它消除了在依赖项跟踪系统中的一类边界情况,也使 Vue 实例在类型检查系统的帮助下运行的更高效。而且在代码可维护性方面也有一点重要的考虑:`data` 对象就像组件状态的概要,提前声明所有的响应式属性,可以让组件代码在以后重新阅读或其他开发人员阅读时更易于被理解。

Expand Down