File tree Expand file tree Collapse file tree 5 files changed +19
-21
lines changed Expand file tree Collapse file tree 5 files changed +19
-21
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
3
<input v-model =" msg" >
4
- <p >prop: {{propMessage}}</p >
5
- <p >msg: {{msg}}</p >
6
- <p >helloMsg: {{helloMsg}}</p >
7
- <p >computed msg: {{computedMsg}}</p >
4
+ <p >prop: {{ propMessage }}</p >
5
+ <p >msg: {{ msg }}</p >
6
+ <p >helloMsg: {{ helloMsg }}</p >
7
+ <p >computed msg: {{ computedMsg }}</p >
8
+ <Hello ref =" helloComponent" />
9
+ <World />
8
10
<button @click =" greet" >Greet</button >
9
- <hello ref =" helloComponent" ></hello >
10
- <World />
11
11
</div >
12
12
</template >
13
13
14
14
<script lang="ts">
15
15
import Vue from ' vue'
16
16
import Component from ' ../lib/index'
17
- import Hello from ' ./Hello.vue' ;
18
- import World from ' ./World.tsx '
17
+ import Hello from ' ./Hello.vue'
18
+ import World from ' ./World'
19
19
20
20
@Component ({
21
21
props: {
@@ -36,7 +36,6 @@ export default class App extends Vue {
36
36
// use prop values for initial data
37
37
helloMsg: string = ' Hello, ' + this .propMessage
38
38
39
-
40
39
// lifecycle hook
41
40
mounted () {
42
41
this .greet ()
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" hello" >
3
- <h1 >Hello Times: {{ helloTimes }}</h1 >
4
- </div >
2
+ <p >hello times: {{ helloTimes }}</p >
5
3
</template >
6
4
7
5
<script lang="ts">
11
9
@Component
12
10
export default class Hello extends Vue {
13
11
helloTimes: number = 0
14
- sayHello() {
15
- this .helloTimes ++ ;
12
+
13
+ sayHello () {
14
+ this .helloTimes ++
16
15
}
17
16
}
18
17
</script >
Original file line number Diff line number Diff line change 1
- import Vue , { CreateElement } from 'vue'
1
+ import Vue , { CreateElement } from 'vue'
2
2
import Component from '../lib/index'
3
3
4
4
@Component
5
5
export default class World extends Vue {
6
-
7
6
render ( h : CreateElement ) {
8
- return < h1 > tsx render function </ h1 >
7
+ return < p > This is rendered via TSX </ p >
9
8
}
10
9
}
Original file line number Diff line number Diff line change 1
- import Vue , { VNode } from "vue" ;
1
+ import Vue , { VNode } from "vue"
2
+
2
3
declare global {
3
4
namespace JSX {
4
5
interface Element extends VNode { }
5
6
interface ElementClass extends Vue { }
6
7
interface IntrinsicElements {
7
- [ elem : string ] : any ;
8
+ [ elem : string ] : any
8
9
}
9
10
}
10
- }
11
+ }
Original file line number Diff line number Diff line change 1
- declare module " *.vue" {
1
+ declare module ' *.vue' {
2
2
import Vue from 'vue'
3
3
export default Vue
4
4
}
You can’t perform that action at this time.
0 commit comments