2021-12-08 10:47:33 +08:00
|
|
|
<script setup lang="ts">
|
2021-12-16 14:32:20 +08:00
|
|
|
import { reactive } from 'vue'
|
|
|
|
import { ElConfigProvider, ElIcon } from 'element-plus'
|
2021-12-11 11:46:10 +08:00
|
|
|
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
|
|
|
// import en from 'element-plus/lib/locale/lang/en'
|
2021-12-16 14:32:20 +08:00
|
|
|
import { VFrom } from '@/components/Form'
|
|
|
|
import Calendar from '~icons/ep/calendar'
|
2021-12-11 20:50:05 +08:00
|
|
|
|
2021-12-14 17:42:43 +08:00
|
|
|
const schema = reactive<VFormSchema[]>([
|
|
|
|
{
|
|
|
|
field: 'field1',
|
2021-12-15 21:26:14 +08:00
|
|
|
component: 'Divider',
|
|
|
|
componentProps: {
|
2021-12-16 14:32:20 +08:00
|
|
|
text: 'Input'
|
2021-12-15 21:26:14 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field2',
|
2021-12-16 14:32:20 +08:00
|
|
|
label: 'default',
|
2021-12-14 17:42:43 +08:00
|
|
|
component: 'Input'
|
2021-12-16 14:32:20 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field3',
|
|
|
|
label: 'input-icon1',
|
|
|
|
component: 'Input',
|
|
|
|
componentProps: {
|
|
|
|
suffixIcon: Calendar,
|
|
|
|
prefixIcon: Calendar
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field4',
|
|
|
|
label: 'input-icon2',
|
|
|
|
component: 'Input',
|
|
|
|
componentProps: {
|
|
|
|
slots: {
|
|
|
|
suffix: true,
|
|
|
|
prefix: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field5',
|
|
|
|
label: 'input-mixed',
|
|
|
|
component: 'Input',
|
|
|
|
componentProps: {
|
|
|
|
slots: {
|
|
|
|
prepend: true,
|
|
|
|
append: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field6',
|
|
|
|
label: 'textarea',
|
|
|
|
component: 'Input',
|
|
|
|
componentProps: {
|
|
|
|
type: 'textarea',
|
|
|
|
rows: 1
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'field7',
|
|
|
|
component: 'Divider',
|
|
|
|
componentProps: {
|
|
|
|
text: 'Autocomplete'
|
|
|
|
}
|
2021-12-14 17:42:43 +08:00
|
|
|
}
|
|
|
|
])
|
2021-12-08 10:47:33 +08:00
|
|
|
</script>
|
|
|
|
|
2021-12-11 11:46:10 +08:00
|
|
|
<template>
|
|
|
|
<ElConfigProvider :locale="zhCn">
|
2021-12-16 14:32:20 +08:00
|
|
|
<VFrom :schema="schema">
|
|
|
|
<template #field4-prefix>
|
|
|
|
<ElIcon class="el-input__icon"><Calendar /></ElIcon>
|
|
|
|
</template>
|
|
|
|
<template #field4-suffix>
|
|
|
|
<ElIcon class="el-input__icon"><Calendar /></ElIcon>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #field5-prepend> Http:// </template>
|
|
|
|
<template #field5-append> .com </template>
|
|
|
|
</VFrom>
|
2021-12-11 11:46:10 +08:00
|
|
|
</ElConfigProvider>
|
|
|
|
</template>
|