Skip to content

Update syntax.md #571

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions src/v2/guide/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ Mustache 标签将会被替代为对应数据对象上 `msg` 属性的值。无

<p class="tip">你的站点上动态渲染的任意 HTML 可能会非常危险,因为它很容易导致 [XSS 攻击](https://en.wikipedia.org/wiki/Cross-site_scripting)。请只对可信内容使用 HTML 插值,**绝不要**对用户提供的内容使用插值。</p>

### 特性
### 属性

Mustache 语法不能作用在 HTML 特性上,遇到这种情况应该使用 [v-bind 指令](../api/#v-bind):
Mustache 语法不能作用在 HTML 属性上,遇到这种情况应该使用 [v-bind 指令](../api/#v-bind):

``` html
<div v-bind:id="dynamicId"></div>
```

这同样适用于布尔类特性,如果求值结果是 falsy 的值 (译者注:falsy 不是 `false`,[参考这里](https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy)),则该特性将会被删除
这同样适用于布尔类特性,如果求值结果是 falsy 的值 (译者注:falsy 不是 `false`,[参考这里](https://developer.mozilla.org/zh-CN/docs/Glossary/Falsy)),则该属性将会被删除

``` html
<button v-bind:disabled="isButtonDisabled">Button</button>
Expand Down