interface ObjType {
size: number,
limit: number,
auto: boolean
}
interface Props {
msg?: string
labels?: string[],
obj: objType
}
const props = withDefaults(defineProps<Props>(), {
msg: 'hello',
labels: () => ['one', 'two'],
obj: () => { return { size: 10, limit: 10, auto: false } }
})
interface UploadObjType {
size: Number
limit: Number
msg: any
autoUpload: Boolean
accept: String
current?: String
}
const p = withDefaults(defineProps<{
uploadObj: UploadObjType
}>(),{
uploadObj: ()=>{
return{
size: 10,
limit: 1,
msg: 'any',
autoUpload: true,
accept: 'jpg',
current: 'aaa'
}
}
})
const p = defineProps({
uploadObj:{
type: Object,
default: ()=>{
return{
size: 101,
limit: 1,
msg: 'any',
autoUpload: true,
accept: 'jpg',
current: 'aaa'
}
}
}
})