We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3908106 commit ce4175bCopy full SHA for ce4175b
README.md
@@ -117,6 +117,33 @@ export default Vue.extend({
117
</script>
118
```
119
120
+Alternatively, you can also annote your prop types with an anonymous function:
121
+
122
+```vue
123
+import Vue from 'vue'
124
125
+<script lang="ts">
126
+import Vue from "vue";
127
128
+interface PersonInfo {
129
+ firstName: string,
130
+ surname: string,
131
+ age: number
132
+}
133
134
+export default Vue.extend({
135
136
+ name: "InfoCard",
137
+ props: {
138
+ info: {
139
+ type: Object as () => PersonInfo,
140
+ required: true
141
+ }
142
143
+});
144
+</script>
145
+```
146
147
## Data Properties (Options API)
148
149
You can enforce types on Vue data properties by annotating the return data object:
0 commit comments