Skip to content

Commit 6dfbcc6

Browse files
authored
Update v3 directive example to have quoted string (#634)
I've seen this cause confusion several times. The examples don't show a variable `yellow` defined, and because a string is expected the example, as is, will fail. I believe adding the extra `'` quotes will make it clearer, and for anyone copy-pasting won't cause issues. Alternatively, the variable could be shown, but that would make examples longer.
1 parent bcaf583 commit 6dfbcc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/migration/custom-directives.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ In Vue 2, custom directives were created by using the hooks listed below to targ
2727
Here’s an example of this:
2828

2929
```html
30-
<p v-highlight="yellow">Highlight this text bright yellow</p>
30+
<p v-highlight="'yellow'">Highlight this text bright yellow</p>
3131
```
3232

3333
```js
@@ -68,7 +68,7 @@ const MyDirective = {
6868
The resulting API could be used like this, mirroring the example from earlier:
6969

7070
```html
71-
<p v-highlight="yellow">Highlight this text bright yellow</p>
71+
<p v-highlight="'yellow'">Highlight this text bright yellow</p>
7272
```
7373

7474
```js

0 commit comments

Comments
 (0)