Created
January 24, 2018 17:18
-
-
Save matthieu-D/e81f5f9004570ffafedd1325bbba9fca to your computer and use it in GitHub Desktop.
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
import Vue from 'vue' | |
import Component from 'vue-class-component' | |
// The @Component decorator indicates the class is a Vue component | |
@Component({ | |
// All component options are allowed in here | |
template: '<div>{{message}} <button @click="onClick">Click!</button></div>' | |
}) | |
export default class SimpleTsComponent extends Vue { | |
// Initial data can be declared as instance properties | |
message: string = 'Hello!' | |
// Component methods can be declared as instance methods | |
onClick (): void { | |
console.log('TypeScript working!'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment