tsconfig.json
"compilerOptions": {
...
"target": "esnext",
"module": "esnext",
"strict": true,
"noImplicitAny": false,
"noImplicitThis": false,
...
}
Vrac
x: [String, Number, Array as () => Array<string | number>]
<script lang="ts">
import Vue from "vue"
type ComplexObjectInterface = {
testProp: string
modelName: number
}
export default Vue.extend({
props: {
propExample: {
type: Object as () => 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>