Skip to content

Instantly share code, notes, and snippets.

@mitchell-garcia
Last active January 16, 2018 01:34
Show Gist options
  • Save mitchell-garcia/1f853b3e2432eb549e2760aa9f118030 to your computer and use it in GitHub Desktop.
Save mitchell-garcia/1f853b3e2432eb549e2760aa9f118030 to your computer and use it in GitHub Desktop.
<script lang="ts">
import Vue, { PropTypes } from "vue"
type ComplexObjectInterface = {
testProp: string
modelName: number
}
export default Vue.extend({
props: {
propExample: {
// NOTE: This functionality does not exist yet,
// watch the below Github thread for updates
// https://github.com/vuejs/vue/pull/6856
type: Object as PropTypes<ComplexObjectInterface>
}
},
data() {
return {
dataExample: "This Property Will Be Data"
}
},
computed: {
computedExample(): string {
return (
this.dataExample +
this.propExample.testProp +
"Computed Property Example"
)
}
},
methods: {
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