2021-12-08 10:47:33 +08:00
|
|
|
<script setup lang="ts">
|
2021-12-11 20:50:05 +08:00
|
|
|
import { ref, onMounted, unref } from 'vue'
|
2021-12-11 11:46:10 +08:00
|
|
|
import { ElConfigProvider } from 'element-plus'
|
|
|
|
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
|
|
|
// import en from 'element-plus/lib/locale/lang/en'
|
2021-12-11 20:50:05 +08:00
|
|
|
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)
|
|
|
|
})
|
2021-12-08 10:47:33 +08:00
|
|
|
</script>
|
|
|
|
|
2021-12-11 11:46:10 +08:00
|
|
|
<template>
|
|
|
|
<ElConfigProvider :locale="zhCn">
|
2021-12-11 20:50:05 +08:00
|
|
|
<BfFrom ref="formRef" />
|
|
|
|
<Component :is="BfFrom" />
|
|
|
|
<!-- <RouterView class="app" /> -->
|
2021-12-11 11:46:10 +08:00
|
|
|
</ElConfigProvider>
|
|
|
|
</template>
|