Last active
April 22, 2020 03:11
-
-
Save lakshyabatman/479972e49cf8b36c57337b2a3026df93 to your computer and use it in GitHub Desktop.
Test component with a lifecycle method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<p>Hi this is test template</p> | |
</div> | |
</template> | |
<script lang="ts"> | |
import Vue from 'vue'; | |
import { Component, Prop} from 'vue-property-decorator'; | |
import AnotherComponent from './another-component.vue' | |
@Component({ | |
components: { | |
'another-one': AnotherComponent, | |
}, | |
name:'Test component' | |
}) | |
export default class TestComponent extends Vue { | |
@Prop({default: 'default value'}) | |
myProp : string | { isObject : true } | any | |
mounted() { | |
console.log("Hi this component is mounted now!"); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment