File tree 7 files changed +418
-34
lines changed 7 files changed +418
-34
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"dependencies" : {
11
11
"core-js" : " ^3.6.5" ,
12
- "vue" : " ^3.0.0"
12
+ "vue" : " ^3.0.0" ,
13
+ "vue-class-component" : " ^8.0.0-0"
13
14
},
14
15
"devDependencies" : {
16
+ "@typescript-eslint/eslint-plugin" : " ^2.33.0" ,
17
+ "@typescript-eslint/parser" : " ^2.33.0" ,
15
18
"@vue/cli-plugin-babel" : " ~4.5.0" ,
16
19
"@vue/cli-plugin-eslint" : " ~4.5.0" ,
20
+ "@vue/cli-plugin-typescript" : " ~4.5.0" ,
17
21
"@vue/cli-service" : " ~4.5.0" ,
18
22
"@vue/compiler-sfc" : " ^3.0.0" ,
23
+ "@vue/eslint-config-typescript" : " ^5.0.2" ,
19
24
"babel-eslint" : " ^10.1.0" ,
20
25
"eslint" : " ^6.7.2" ,
21
- "eslint-plugin-vue" : " ^7.0.0-0"
26
+ "eslint-plugin-vue" : " ^7.0.0-0" ,
27
+ "typescript" : " ~3.9.3"
22
28
},
23
29
"eslintConfig" : {
24
30
"root" : true ,
27
33
},
28
34
"extends" : [
29
35
" plugin:vue/vue3-essential" ,
30
- " eslint:recommended"
36
+ " eslint:recommended" ,
37
+ " @vue/typescript"
31
38
],
32
39
"parserOptions" : {
33
- "parser" : " babel -eslint"
40
+ "parser" : " @typescript -eslint/parser "
34
41
},
35
42
"rules" : {}
36
43
},
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<img alt =" Vue logo" src =" ./assets/logo.png" >
3
- <HelloWorld msg =" Welcome to Your Vue.js App" />
3
+ <HelloWorld msg =" Welcome to Your Vue.js + TypeScript App" />
4
4
</template >
5
5
6
- <script >
7
- import HelloWorld from ' ./components/HelloWorld.vue'
6
+ <script lang="ts">
7
+ import { Options , Vue } from ' vue-class-component' ;
8
+ import HelloWorld from ' ./components/HelloWorld.vue' ;
8
9
9
- export default {
10
- name: ' App' ,
10
+ @Options ({
11
11
components: {
12
- HelloWorld
13
- }
14
- }
12
+ HelloWorld ,
13
+ },
14
+ })
15
+ export default class App extends Vue {}
15
16
</script >
16
17
17
18
<style >
Original file line number Diff line number Diff line change 8
8
</p >
9
9
<h3 >Installed CLI Plugins</h3 >
10
10
<ul >
11
- <li ><a href =" https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target =" _blank" rel =" noopener" >babel</a ></li >
12
- <li ><a href =" https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target =" _blank" rel =" noopener" >eslint</a ></li >
11
+ <li ><a href =" https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-typescript" target =" _blank" rel =" noopener" >typescript</a ></li >
13
12
</ul >
14
13
<h3 >Essential Links</h3 >
15
14
<ul >
30
29
</div >
31
30
</template >
32
31
33
- <script >
34
- export default {
35
- name: ' HelloWorld' ,
32
+ <script lang="ts">
33
+ import { Options , Vue } from ' vue-class-component' ;
34
+
35
+ @Options ({
36
36
props: {
37
37
msg: String
38
38
}
39
+ })
40
+ export default class HelloWorld extends Vue {
41
+ msg! : string
39
42
}
40
43
</script >
41
44
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ /* eslint-disable */
2
+ declare module '*.vue' {
3
+ import type { DefineComponent } from 'vue'
4
+ const component : DefineComponent < { } , { } , any >
5
+ export default component
6
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " es5" ,
4
+ "module" : " esnext" ,
5
+ "strict" : true ,
6
+ "jsx" : " preserve" ,
7
+ "importHelpers" : true ,
8
+ "moduleResolution" : " node" ,
9
+ "experimentalDecorators" : true ,
10
+ "allowJs" : true ,
11
+ "skipLibCheck" : true ,
12
+ "esModuleInterop" : true ,
13
+ "allowSyntheticDefaultImports" : true ,
14
+ "sourceMap" : true ,
15
+ "baseUrl" : " ." ,
16
+ "types" : [
17
+ " webpack-env"
18
+ ],
19
+ "paths" : {
20
+ "@/*" : [
21
+ " src/*"
22
+ ]
23
+ },
24
+ "lib" : [
25
+ " esnext" ,
26
+ " dom" ,
27
+ " dom.iterable" ,
28
+ " scripthost"
29
+ ]
30
+ },
31
+ "include" : [
32
+ " src/**/*.ts" ,
33
+ " src/**/*.tsx" ,
34
+ " src/**/*.vue" ,
35
+ " tests/**/*.ts" ,
36
+ " tests/**/*.tsx"
37
+ ],
38
+ "exclude" : [
39
+ " node_modules"
40
+ ]
41
+ }
You can’t perform that action at this time.
0 commit comments