Last active
January 16, 2018 01:43
-
-
Save mitchell-garcia/58f81eb04f6e33bca7b24ba583e35c19 to your computer and use it in GitHub Desktop.
Single File Component Example
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
<script lang="ts"> | |
import Component from "vue-class-component" | |
import { Prop } from "vue-property-decorator" | |
type ComplexObjectInterface = { | |
testProp: string | |
modelName: number | |
} | |
@Component | |
export default ComponentName extends Component { | |
@Prop({ | |
type: Object | |
}) | |
propExample: ComplexObjectInterface | |
dataExample: string = "This Property Will Be Data" | |
get computedExample() { | |
return this.dataExample + this.propExample.testProp + "Computed Property Example"; | |
} | |
methodExample() { | |
this.dataExample = "This is being done in a method" | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment