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 7963ad9 commit 3908106Copy full SHA for 3908106
class-components.md
@@ -76,7 +76,33 @@ interface PersonInfo {
76
77
@Component
78
export default class InfoCard extends Vue {
79
- @Prop({ required: true }) readonly info: PersonInfo;
+ @Prop() readonly info!: PersonInfo;
80
+ @Prop({ default: false }) readonly admin?: boolean;
81
}
82
</script>
83
+```
84
+Is equivalent to:
85
+
86
+```ts
87
+import Vue from "vue-property-decorator";
88
+import Vue, { PropType } from 'vue'
89
90
+interface PersonInfo {
91
+ firstName: string,
92
+ surname: string,
93
+ age: number
94
+}
95
+export default {
96
+ props: {
97
+ info: {
98
+ type: Object as PropType<PersonInfo>,
99
+ required: true
100
+ },
101
+ admin: {
102
+ type: Boolean,
103
+ default: false
104
+ }
105
106
107
108
```
0 commit comments