Created
December 22, 2018 09:57
-
-
Save tqwewe/4ad6bd2e7cd1a78e164c8d9b6d4230b1 to your computer and use it in GitHub Desktop.
Vue Typescript Component with all properties sorted to vue spec
This file contains hidden or 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
import { Vue, Component, Model, Prop, Watch } from 'vue-property-decorator' | |
@Component({ | |
delimiters: ['{{', '}}'], | |
comments: false, | |
components: null, | |
directives: null, | |
filters: null, | |
inheritAttrs: true, | |
}) | |
export default class RouletteBar extends Vue { | |
// Interface | |
@Model('change', { type: Boolean }) checked!: boolean | |
@Prop(Number) propA!: number | |
// Local State | |
dataA = 'foo' | |
get computedA() { | |
return 'foo' | |
} | |
// Events | |
@Watch('child') | |
onChildChanged(newValue: string, oldValue: string) { } | |
beforeCreate() { } | |
created() { } | |
beforeMount() { } | |
mounted() { } | |
beforeUpdate() { } | |
updated() { } | |
activated() { } | |
deactivated() { } | |
beforeDestroy() { } | |
destroyed() { } | |
// Non-Reactive Properties | |
methodA() { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment