-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Update reactivity.md #697
Conversation
前一半 LGTM。 后面一半感觉原文挺清晰的呀? |
src/v2/guide/reactivity.md
Outdated
@@ -70,7 +70,7 @@ var vm = new Vue({ | |||
vm.message = 'Hello!' | |||
``` | |||
|
|||
如果你在 data 选项中未声明 `message`,Vue 将警告你渲染函数在试图访问的属性不存在。 | |||
如果你未在 data 选项中声明 `message`,Vue 会抛出向你一条警告:render 函数正在试图访问的一个属性,在实例中并不存在。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“……Vue 将警告你渲染函数正在试图访问一个不存在的属性。”这样更好一些吗?
Btw. 这里原文的 render function 我觉得应该翻译成“渲染函数”,而不是特指 render
这个函数名。如果是后者的话,原文这里会用反引号括起来。
谢谢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实我想强调的是正在
和在实例 data 中
,我修正一下。
src/v2/guide/reactivity.md
Outdated
@@ -70,7 +70,7 @@ var vm = new Vue({ | |||
vm.message = 'Hello!' | |||
``` | |||
|
|||
如果你在 data 选项中未声明 `message`,Vue 将警告你渲染函数在试图访问的属性不存在。 | |||
如果你未在 data 选项中声明 `message`,Vue 将警告你渲染函数正在试图访问的属性在实例的 data 中不存在。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加上 data 是不对的,因为 Vue 并不会知道你的数据会在 data
/props
/computed
中的哪一个。Vue 只能知道不存在。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
想了想这个案例是以 data 举例,说在实例的 data 中也是可以,不过想想还是改回原译吧。
No description provided.