-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Translated D1~D4 of style guide #564
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
Conversation
src/v2/style-guide/index.md
Outdated
|
||
Prefer class selectors over element selectors in `scoped` styles, because large numbers of element selectors are slow. | ||
在 `scoped` 样式中,class 选择器比元素选择器更好,因为大量使用元素选择器是很慢的。 |
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.
element selector 翻译成元素选择器,class selector 应该对应为类选择器?
src/v2/style-guide/index.md
Outdated
@@ -1590,13 +1590,13 @@ button { | |||
|
|||
|
|||
|
|||
### Parent-child communication <sup data-p="d">use with caution</sup> | |||
### 父子通信 <sup data-p="d">谨慎使用</sup> |
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.
父子组件通信?
src/v2/style-guide/index.md
Outdated
|
||
An ideal Vue application is props down, events up. Sticking to this convention makes your components much easier to understand. However, there are edge cases where prop mutation or `this.$parent` can simplify two components that are already deeply coupled. | ||
一个理想的 Vue 应用是 prop 下行,event 上行的。遵循这一约定会让你的组件更易于理解。然而,在一些边界情况下 prop 的变更或 `this.$parent` 能够简化两个深度耦合的组件。 |
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.
“props down, events up”需要约定一下?我之前翻译的是“prop 向下传递,事件向上传递”。
src/v2/style-guide/index.md
Outdated
|
||
The problem is, there are also many _simple_ cases where these patterns may offer convenience. Beware: do not be seduced into trading simplicity (being able to understand the flow of your state) for short-term convenience (writing less code). | ||
问题在于,这种_简单_往往也会带来便利的。当心不要以牺牲简洁性 (理解你的状态流向) 为代价换取短期的便利 (少写代码)。 |
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.
“问题在于,这种做法在很多_简单_的场景下可能会更方便。但请当心,不要为了一时方便 (少写代码) 而牺牲数据流向的简洁性 (易于理解)。”
我理解是说:这么做很多场景下很方便,但是会引诱我们为了少写代码而破坏数据流向的简单约定。稍微调整了括号内外的内容以使中文更通顺一些。
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.
恩,这样蛮好的。
All done. |
No description provided.