feat: Add Search component and add search demo

This commit is contained in:
陈凯龙
2022-01-28 11:36:18 +08:00
parent 8a958cd71d
commit 33eca8a97d
8 changed files with 281 additions and 8 deletions

View File

@@ -52,10 +52,16 @@ export default defineComponent({
const elFormRef = ref<ComponentRef<typeof ElForm>>()
// useForm传入的props
const outsideProps = ref<FormProps>({ ...props })
const outsideProps = ref<FormProps>({})
const getProps = computed(() => {
return { ...props, ...unref(outsideProps) }
const propsObj = { ...props }
for (const key in unref(outsideProps)) {
if (Reflect.has(propsObj, key)) {
propsObj[key] = unref(outsideProps)[key]
}
}
return propsObj
})
// 表单数据
@@ -71,7 +77,7 @@ export default defineComponent({
}
const setProps = (props: FormProps = {}) => {
outsideProps.value = Object.assign(unref(formModel), props)
outsideProps.value = props
}
const delSchema = (field: string) => {