Skip to content

Update syntax.md #1058

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 1 commit into from
Apr 8, 2020
Merged
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
4 changes: 2 additions & 2 deletions src/v2/guide/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ Mustache 语法不能作用在 HTML attribute 上,遇到这种情况应该使

<!-- 缩写 -->
<a :href="url">...</a>
```

<!-- 动态参数的缩写 (2.6.0+) -->
<a :[key]="url"> ... </a>
```

### `v-on` 缩写

Expand All @@ -215,9 +215,9 @@ Mustache 语法不能作用在 HTML attribute 上,遇到这种情况应该使

<!-- 缩写 -->
<a @click="doSomething">...</a>
```

<!-- 动态参数的缩写 (2.6.0+) -->
<a @[event]="doSomething"> ... </a>
```

它们看起来可能与普通的 HTML 略有不同,但 `:` 与 `@` 对于 attribute 名来说都是合法字符,在所有支持 Vue 的浏览器都能被正确地解析。而且,它们不会出现在最终渲染的标记中。缩写语法是完全可选的,但随着你更深入地了解它们的作用,你会庆幸拥有它们。