types(VForm): Adding VForm types

This commit is contained in:
陈凯龙
2021-12-13 16:55:58 +08:00
parent bc9195b21e
commit 7528fe6da6
14 changed files with 217 additions and 80 deletions

View File

@@ -3,14 +3,14 @@ import { ref, onMounted, unref } from 'vue'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
// import en from 'element-plus/lib/locale/lang/en'
import { BfFrom, BfFormExpose } from '@/components/Form'
const formRef = ref<ComponentRef<typeof BfFrom> & BfFormExpose>()
import { VFrom, VFormExpose } from '@/components/Form'
const formRef = ref<ComponentRef<typeof VFrom> & VFormExpose>()
onMounted(() => {
const form = unref(formRef.value)
console.log(form?.$el)
const schema: BfFormSchema = [
const schema: VFormSchema = [
{
field: '1',
colProps: {}
@@ -22,8 +22,8 @@ onMounted(() => {
<template>
<ElConfigProvider :locale="zhCn">
<BfFrom ref="formRef" />
<Component :is="BfFrom" />
<VFrom ref="formRef" />
<Component :is="VFrom" />
<!-- <RouterView class="app" /> -->
</ElConfigProvider>
</template>