types: Adding BfFrom Component types
This commit is contained in:
22
src/App.vue
22
src/App.vue
@@ -1,11 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
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<InstanceType<typeof BfFrom> & BfFormExpose>()
|
||||
|
||||
onMounted(() => {
|
||||
const form = unref(formRef.value)
|
||||
console.log(form?.count)
|
||||
form?.sayHello()
|
||||
console.log(form?.$el)
|
||||
|
||||
const schema: BfFormSchema = [
|
||||
{
|
||||
field: '1',
|
||||
colProps: {}
|
||||
}
|
||||
]
|
||||
console.log(schema)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElConfigProvider :locale="zhCn">
|
||||
<RouterView class="app" />
|
||||
<BfFrom ref="formRef" />
|
||||
<Component :is="BfFrom" />
|
||||
<!-- <RouterView class="app" /> -->
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user