Skip to content

Commit e177bd3

Browse files
committed
App component rewritten in TS
1 parent e5f4262 commit e177bd3

File tree

2 files changed

+20
-36
lines changed

2 files changed

+20
-36
lines changed

ClientApp/src/App.vue

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,23 @@
3737
</v-app>
3838
</template>
3939

40-
<script>
41-
import HelloWorld from './components/HelloWorld';
40+
<script lang="ts">
41+
import HelloWorld from '@/components/HelloWorld.vue';
42+
import { Component, Vue } from 'vue-property-decorator';
4243
43-
export default {
44-
name: 'App',
45-
components: {
46-
HelloWorld,
47-
},
48-
data() {
49-
return {
50-
clipped: true,
51-
drawer: true,
52-
items: [
53-
{
54-
title: 'Home',
55-
icon: 'home',
56-
link: '/',
57-
},
58-
{
59-
title: 'Counter',
60-
icon: 'touch_app',
61-
link: '/counter',
62-
},
63-
{
64-
title: 'Fetch data',
65-
icon: 'get_app',
66-
link: '/fetch-data',
67-
},
68-
],
69-
miniVariant: false,
70-
right: true,
71-
title: 'ASP.NET Core Vue Starter',
72-
};
73-
},
74-
};
44+
@Component({
45+
components: { HelloWorld },
46+
})
47+
export default class App extends Vue {
48+
private clipped: boolean = true;
49+
private drawer: boolean = true;
50+
private miniVariant: boolean = false;
51+
private right: boolean = true;
52+
private title: string = 'ASP.NET Core Vue Starter';
53+
private items = [
54+
{ title: 'Home', icon: 'home', link: '/' },
55+
{ title: 'Counter', icon: 'touch_app', link: '/counter' },
56+
{ title: 'Fetch data', icon: 'get_app', link: '/fetch-data' },
57+
];
58+
}
7559
</script>

ClientApp/src/components/Counter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<p>Current count (Vuex):
44
<strong>{{ currentCount }}</strong>
55
</p>
6-
<v-btn color="info" @click.prevent="increment()">Increment</v-btn>
7-
<v-btn color="info" @click.prevent="reset()">Reset</v-btn>
6+
<v-btn color="info" @click.prevent="increment">Increment</v-btn>
7+
<v-btn color="info" @click.prevent="reset">Reset</v-btn>
88
</div>
99
</template>
1010

0 commit comments

Comments
 (0)