Last active
January 16, 2018 01:34
-
-
Save mitchell-garcia/1f853b3e2432eb549e2760aa9f118030 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
<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