diff --git a/src/v2/guide/syntax.md b/src/v2/guide/syntax.md index 3b08d4639b..6cab7c77c9 100644 --- a/src/v2/guide/syntax.md +++ b/src/v2/guide/syntax.md @@ -95,7 +95,7 @@ Here, the `v-if` directive would remove/insert the `

` element based on the tr Some directives can take an "argument", denoted by a colon after the directive name. For example, the `v-bind` directive is used to reactively update an HTML attribute: ``` html - + ... ``` Here `href` is the argument, which tells the `v-bind` directive to bind the element's `href` attribute to the value of the expression `url`. @@ -103,7 +103,7 @@ Here `href` is the argument, which tells the `v-bind` directive to bind the elem Another example is the `v-on` directive, which listens to DOM events: ``` html - + ... ``` Here the argument is the event name to listen to. We will talk about event handling in more detail too. @@ -113,7 +113,7 @@ Here the argument is the event name to listen to. We will talk about event handl Modifiers are special postfixes denoted by a dot, which indicate that a directive should be bound in some special way. For example, the `.prevent` modifier tells the `v-on` directive to call `event.preventDefault()` on the triggered event: ``` html -

+
...
``` You'll see other examples of modifiers later, [for `v-on`](events.html#Event-Modifiers) and [for `v-model`](forms.html#Modifiers), when we explore those features. @@ -126,20 +126,20 @@ The `v-` prefix serves as a visual cue for identifying Vue-specific attributes i ``` html - + ... - + ... ``` ### `v-on` Shorthand ``` html - + ... - + ... ``` They may look a bit different from normal HTML, but `:` and `@` are valid chars for attribute names and all Vue.js supported browsers can parse it correctly. In addition, they do not appear in the final rendered markup. The shorthand syntax is totally optional, but you will likely appreciate it when you learn more about its usage later.