File tree Expand file tree Collapse file tree 1 file changed +29
-38
lines changed Expand file tree Collapse file tree 1 file changed +29
-38
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,13 @@ For example:
16
16
```
17
17
18
18
``` js
19
- Vue .createApp ().mount (
20
- {
21
- data () {
22
- return {
23
- counter: 1
24
- }
25
- }
26
- },
27
- ' #example-1'
28
- )
19
+ Vue .createApp ({
20
+ data () {
21
+ return {
22
+ counter: 1
23
+ };
24
+ }
25
+ }).mount (" #example-1" );
29
26
```
30
27
31
28
Result:
@@ -46,26 +43,23 @@ For example:
46
43
```
47
44
48
45
``` js
49
- Vue .createApp ().mount (
50
- {
51
- data () {
52
- return {
53
- name: ' Vue.js'
54
- }
55
- },
56
- methods: {
57
- greet (event ) {
58
- // `this` inside methods points to the Vue instance
59
- alert (' Hello ' + this .name + ' !' )
60
- // `event` is the native DOM event
61
- if (event ) {
62
- alert (event .target .tagName )
63
- }
46
+ Vue .createApp ({
47
+ data () {
48
+ return {
49
+ name: " Vue.js"
50
+ };
51
+ },
52
+ methods: {
53
+ greet (event ) {
54
+ // `this` inside methods points to the Vue instance
55
+ alert (" Hello " + this .name + " !" );
56
+ // `event` is the native DOM event
57
+ if (event ) {
58
+ alert (event .target .tagName );
64
59
}
65
60
}
66
- },
67
- ' #example-2'
68
- )
61
+ }
62
+ }).mount (" #example-2" );
69
63
```
70
64
71
65
Result:
@@ -84,16 +78,13 @@ Instead of binding directly to a method name, we can also use methods in an inli
84
78
```
85
79
86
80
``` js
87
- Vue .createApp ().mount (
88
- {
89
- methods: {
90
- say (message ) {
91
- alert (message)
92
- }
81
+ Vue .createApp ({
82
+ methods: {
83
+ say (message ) {
84
+ alert (message);
93
85
}
94
- },
95
- ' #example-3'
96
- )
86
+ }
87
+ }).mount (" #example-3" );
97
88
```
98
89
99
90
Result:
@@ -229,7 +220,7 @@ You can also [define custom key modifier aliases](TODO:../api/#keyCodes) via the
229
220
230
221
``` js
231
222
// enable `v-on:keyup.f1`
232
- Vue .config .keyCodes .f1 = 112
223
+ Vue .config .keyCodes .f1 = 112 ;
233
224
```
234
225
235
226
## System Modifier Keys
You can’t perform that action at this time.
0 commit comments