-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Refine "Conditional" #556
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
Refine "Conditional" #556
Conversation
src/v2/guide/conditional.md
Outdated
|
||
因为 `v-if` 是一个指令,需要将它添加到一个元素上。但是如果我们想切换多个元素呢?此时我们可以把一个 `<template>` 元素当做包装元素,并在上面使用 `v-if`。最终的渲染结果不会包含 `<template>` 元素。 | ||
因为 `v-if` 是一个指令,所以必须将它添加到一个元素上。但是如果想切换多个元素呢?此时可以把一个 `<template>` 元素当做不可见的包装元素,并在上面使用 `v-if`。最终的渲染结果将不包含 `<template>` 元素。 |
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/guide/conditional.md
Outdated
@@ -6,7 +6,7 @@ order: 7 | |||
|
|||
## `v-if` | |||
|
|||
在字符串模板中,如 Handlebars ,我们得像这样写一个条件块: | |||
在比如 Handlebars 这样的字符串模板中,我们得像这样写一个条件块: |
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.
修改前后略有点不同,前者更特指 Handlebars 一些,后者更突出“这样的字符串模板中”,从原文意思看还是偏向理解为前者
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.
OK
@@ -180,19 +180,19 @@ new Vue({ | |||
<h1 v-show="ok">Hello!</h1> | |||
``` | |||
|
|||
不同的是带有 `v-show` 的元素始终会被渲染并保留在 DOM 中。`v-show` 是简单地切换元素的 CSS 属性 `display` 。 | |||
不同的是带有 `v-show` 的元素始终会被渲染并保留在 DOM 中。`v-show` 只是简单地切换元素的 CSS 属性 `display`。 |
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.
“CSS 属性 display
”直接译为“display
样式”?
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.
“CSS 属性 display
”我感觉精确一些?
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.
恩 都可以 没问题
No description provided.