8000 fix code tags (#1262) · kdncode/vuejs.org@ce5efe4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce5efe4

Browse files
Justineochrisvfritz
authored andcommitted
fix code tags (vuejs#1262)
1 parent 0ffc42a commit ce5efe4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/v2/guide/custom-directive.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ new Vue({
2424
</script>
2525
{% endraw %}
2626

27-
When the page loads, that element gains focus (note: autofocus doesn't work on mobile Safari). In fact, if you haven't clicked on anything else since visiting this page, the input above should be focused now. Now let's build the directive that accomplishes this:
27+
When the page loads, that element gains focus (note: `autofocus` doesn't work on mobile Safari). In fact, if you haven't clicked on anything else since visiting this page, the input above should be focused now. Now let's build the directive that accomplishes this:
2828

2929
``` js
30-
// Register a global custom directive called v-focus
30+
// Register a global custom directive called `v-focus`
3131
Vue.directive('focus', {
3232
// When the bound element is inserted into the DOM...
3333
inserted: function (el) {
@@ -76,16 +76,16 @@ We'll explore the arguments passed into these hooks (i.e. `el`, `binding`, `vnod
7676

7777
Directive hooks are passed these arguments:
7878

79-
- **el**: The element the directive is bound to. This can be used to directly manipulate the DOM.
80-
- **binding**: An object containing the following properties.
81-
- **name**: The name of the directive, without the `v-` prefix.
82-
- **value**: The value passed to the directive. For example in `v-my-directive="1 + 1"`, the value would be `2`.
83-
- **oldValue**: The previous value, only available in `update` and `componentUpdated`. It is available whether or not the value has changed.
84-
- **expression**: The expression of the binding as a string. For example in `v-my-directive="1 + 1"`, the expression would be `"1 + 1"`.
85-
- **arg**: The argument passed to the directive, if any. For example in `v-my-directive:foo`, the arg would be `"foo"`.
86-
- **modifiers**: An object containing modifiers, if any. For example in `v-my-directive.foo.bar`, the modifiers object would be `{ foo: true, bar: true }`.
87-
- **vnode**: The virtual node produced by Vue's compiler. See the [VNode API](../api/#VNode-Interface) for full details.
88-
- **oldVnode**: The previous virtual node, only available in the `update` and `componentUpdated` hooks.
79+
- `el`: The element the directive is bound to. This can be used to directly manipulate the DOM.
80+
- `binding`: An object containing the following properties.
81+
- `name`: The name of the directive, without the `v-` prefix.
82+
- `value`: The value passed to the directive. For example in `v-my-directive="1 + 1"`, the value would be `2`.
83+
- `oldValue`: The previous value, only available in `update` and `componentUpdated`. It is available whether or not the value has changed.
84+
- `expression`: The expression of the binding as a string. For example in `v-my-directive="1 + 1"`, the expression would be `"1 + 1"`.
85+
- `arg`: The argument passed to the directive, if any. For example in `v-my-directive:foo`, the arg would be `"foo"`.
86+
- `modifiers`: An object containing modifiers, if any. For example in `v-my-directive.foo.bar`, the modifiers object would be `{ foo: true, bar: true }`.
87+
- `vnode`: The virtual node produced by Vue's compiler. See the [VNode API](../api/#VNode-Interface) for full details.
88+
- `oldVnode`: The previous virtual node, only available in the `update` and `componentUpdated` hooks.
8989

9090
<p class="tip">Apart from `el`, you should treat these arguments as read-only and never modify them. If you need to share information across hooks, it is recommended to do so through element's [dataset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset).</p>
9191

0 commit comments

Comments
 (0)
0