String
export default defineComponent({
props: {
value1: {
type: String,
required: true,
}
}
});
Number
export default defineComponent({
props: {
value1: {
type: Number,
required: true,
}
}
});
Array
import { defineComponent, PropType } from "vue";
export default defineComponent({
props: {
value1: {
type: Array as PropType <number []>,
required: true,
}
}
});
Object
import { defineComponent, PropType } from "vue";
export default defineComponent({
props: {
value1: {
type: Object as PropType <{value: string, value2: number}>,
required: true,
}
}
});
Function
import { defineComponent, PropType } from "vue";
export default defineComponent({
props: {
value1: {
type: Function as PropType <() => Number>,
required: true,
}
}
});