Skip to content

Commit 2f989e5

Browse files
feat($HelloWorld): use prop to pass data
1 parent 733f4f5 commit 2f989e5

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuetify-typescript-playground",
3-
"version": "0.1.0",
3+
"version": "0.1.0-beta",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src/App.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
</v-btn>
1616
</v-app-bar>
1717
<v-content>
18-
<hello-world/>
18+
<v-sheet class="text-center">
19+
<router-link to="/">Home</router-link>
20+
<span>|</span>
21+
<router-link to="/about">About</router-link>
22+
</v-sheet>
23+
<router-view/>
1924
</v-content>
2025
</v-app>
2126
</template>
@@ -27,9 +32,9 @@ import HelloWorld from './components/HelloWorld.vue'
2732
export default Vue.extend({
2833
name: 'App',
2934
30-
components: {
31-
HelloWorld
32-
},
35+
// components: {
36+
// HelloWorld
37+
// },
3338
3439
data: () => ({
3540
//

src/components/HelloWorld.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!--suppress HtmlUnknownBooleanAttribute -->
22
<template>
33
<v-container>
4+
<div class="text-center">
5+
<v-sheet color="orange lighten-2">{{ msg }}</v-sheet>
6+
</div>
47
<v-layout text-center wrap>
58
<v-flex xs12>
69
<!--suppress HtmlUnknownTarget -->
@@ -55,10 +58,12 @@ export default class HelloWorld extends Vue {
5558

5659
<!--suppress JSUnusedLocalSymbols, JSUnusedGlobalSymbols -->
5760
<script lang="ts">
58-
import { Component, Vue } from 'vue-property-decorator'
61+
import { Component, Prop, Vue } from 'vue-property-decorator'
5962
6063
@Component
6164
export default class HelloWorld extends Vue {
65+
@Prop() private msg!: string
66+
6267
private ecosystem: object = [
6368
{
6469
text: 'vuetify-loader',

src/views/About.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="about">
2+
<div class="text-center">
33
<h1>This is an about page</h1>
44
</div>
55
</template>

src/views/Home.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div class="home">
3-
<img alt="Vue logo" src="../assets/logo.png">
43
<hello-world msg="Welcome to Your Vue.js App"/>
54
</div>
65
</template>

0 commit comments

Comments
 (0)