Skip to content

Commit db6ba8a

Browse files
committed
use vue-class-component
$ npm install vue-class-component --save-dev
1 parent 78bd05d commit db6ba8a

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"node-sass": "^4.5.3",
2222
"sass-loader": "^6.0.6",
2323
"ts-loader": "^3.1.0",
24+
"vue-class-component": "^6.0.0",
2425
"vue-loader": "^13.0.5",
2526
"vue-template-compiler": "^2.4.4",
2627
"vue-ts-loader": "0.0.3",

src/App.vue

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,45 @@
2121

2222
<script lang="ts">
2323
import Vue from "vue";
24+
import Component from 'vue-class-component';
2425
25-
export default Vue.extend({
26-
name: 'app',
27-
26+
@Component({
27+
name: 'app'
28+
})
29+
export default class App extends Vue {
2830
data () {
2931
return {
3032
msg: 'Welcome to Your Vue.js App, supporting TypeScript'
3133
}
3234
}
33-
})
35+
}
3436
</script>
3537

3638
<style lang="scss">
3739
#app {
38-
font-family: 'Avenir', Helvetica, Arial, sans-serif;
39-
-webkit-font-smoothing: antialiased;
40-
-moz-osx-font-smoothing: grayscale;
41-
text-align: center;
42-
color: #2c3e50;
43-
margin-top: 60px;
40+
font-family: 'Avenir', Helvetica, Arial, sans-serif;
41+
-webkit-font-smoothing: antialiased;
42+
-moz-osx-font-smoothing: grayscale;
43+
text-align: center;
44+
color: #2c3e50;
45+
margin-top: 60px;
4446
}
4547
4648
h1, h2 {
47-
font-weight: normal;
49+
font-weight: normal;
4850
}
4951
5052
ul {
51-
list-style-type: none;
52-
padding: 0;
53+
list-style-type: none;
54+
padding: 0;
5355
}
5456
5557
li {
56-
display: inline-block;
57-
margin: 0 10px;
58+
display: inline-block;
59+
margin: 0 10px;
5860
}
5961
6062
a {
61-
color: #42b983;
63+
color: #42b983;
6264
}
6365
</style>

tsconfig.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
22
"compilerOptions": {
33
"lib": ["dom", "es5", "es2015"],
4-
"target": "es5",
5-
"module": "es2015",
4+
"target": "es2015",
5+
"module": "es6",
66
"moduleResolution": "node",
77
"sourceMap": true,
8-
"allowSyntheticDefaultImports": true
8+
"experimentalDecorators": true,
9+
"allowSyntheticDefaultImports": true,
10+
"allowJs": true
911
},
1012
"include": [
1113
"./src/**/*"
14+
],
15+
"exclude": [
16+
"node_modules"
1217
]
1318
}

0 commit comments

Comments
 (0)