Skip to content

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

Merged
merged 3 commits into from
Oct 13, 2017
Merged

Refine "Conditional" #556

merged 3 commits into from
Oct 13, 2017

Conversation

Justineo
Copy link
Member

No description provided.

@Justineo Justineo requested a review from Jinjiang October 12, 2017 04:09

因为 `v-if` 是一个指令,需要将它添加到一个元素上。但是如果我们想切换多个元素呢?此时我们可以把一个 `<template>` 元素当做包装元素,并在上面使用 `v-if`。最终的渲染结果不会包含 `<template>` 元素。
因为 `v-if` 是一个指令,所以必须将它添加到一个元素上。但是如果想切换多个元素呢?此时可以把一个 `<template>` 元素当做不可见的包装元素,并在上面使用 `v-if`。最终的渲染结果将不包含 `<template>` 元素。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用「包裹元素」是不是更好一点?

@@ -6,7 +6,7 @@ order: 7

## `v-if`

在字符串模板中,如 Handlebars ,我们得像这样写一个条件块:
在比如 Handlebars 这样的字符串模板中,我们得像这样写一个条件块:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改前后略有点不同,前者更特指 Handlebars 一些,后者更突出“这样的字符串模板中”,从原文意思看还是偏向理解为前者

Copy link
Member Author

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`。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“CSS 属性 display”直接译为“display 样式”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“CSS 属性 display”我感觉精确一些?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩 都可以 没问题

@Jinjiang Jinjiang merged commit 4f72b5b into vuejs:master Oct 13, 2017
@Justineo Justineo deleted the refine-conditional branch December 4, 2017 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants