参考:
Vue3 Element-Plus 一站式生成动态表单:简化前端开发流程_vue动态生成前端功能页面-CSDN博客
一 v-for 和v-if 不能同时使用
二 类型声明
const props = defineProps<{
formFields: Field[]
}>()
//代表一个业务参数的ts类型
export interface Field {
label?: string
prop?: string | undefined
type?: string
options?: optionList
placeholder?: string
isShow?: boolean
labelWidth?: string
width?: null
isChecked?: boolean
}
export type optionList = option[]
export interface option {
label: string
value: string
}