You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-15Lines changed: 18 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -22,28 +22,30 @@ Note:
22
22
23
23
### Example
24
24
25
-
Following is the example written in Babel. If you are looking for TypeScript version, [it's in the example directory](example/example.ts).
26
-
27
-
```js
25
+
Following is the example written in Babel. If you are looking for TypeScript version, [it's in the example directory](example/App.vue).
26
+
27
+
```vue
28
+
<template>
29
+
<div>
30
+
<input v-model="msg">
31
+
<p>prop: {{propMessage}}</p>
32
+
<p>msg: {{msg}}</p>
33
+
<p>helloMsg: {{helloMsg}}</p>
34
+
<p>computed msg: {{computedMsg}}</p>
35
+
<button @click="greet">Greet</button>
36
+
</div>
37
+
</template>
38
+
39
+
<script>
28
40
import Vue from 'vue'
29
41
import Component from 'vue-class-component'
30
42
31
43
@Component({
32
44
props: {
33
45
propMessage: String
34
-
},
35
-
template:`
36
-
<div>
37
-
<input v-model="msg">
38
-
<p>prop: {{propMessage}}</p>
39
-
<p>msg: {{msg}}</p>
40
-
<p>helloMsg: {{helloMsg}}</p>
41
-
<p>computed msg: {{computedMsg}}</p>
42
-
<button @click="greet">Greet</button>
43
-
</div>
44
-
`
46
+
}
45
47
})
46
-
classAppextendsVue {
48
+
export default class App extends Vue {
47
49
// initial data
48
50
msg = 123
49
51
@@ -65,6 +67,7 @@ class App extends Vue {
65
67
alert('greeting: ' + this.msg)
66
68
}
67
69
}
70
+
</script>
68
71
```
69
72
70
73
You may also want to check out the `@prop` and `@watch` decorators provided by [vue-property-decorators](https://github.com/kaorun343/vue-property-decorator).
0 commit comments