wip(VForm): VForm coding
This commit is contained in:
@@ -66,16 +66,20 @@ export default defineComponent({
|
||||
typeof defineComponent
|
||||
>
|
||||
return (
|
||||
<Com
|
||||
v-model={test.value}
|
||||
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
||||
></Com>
|
||||
<Com v-model={test.value} {...(autoSetPlaceholder && setTextPlaceholder(item))}>
|
||||
{item.options ? renderOptions() : null}
|
||||
</Com>
|
||||
)
|
||||
}}
|
||||
</ElFormItem>
|
||||
)
|
||||
})
|
||||
// return <div>{schema[0]?.field}</div>
|
||||
}
|
||||
|
||||
// 渲染options
|
||||
function renderOptions() {
|
||||
// const optionsMap = ['Radio', 'Checkbox', 'Select']
|
||||
return <div>2222</div>
|
||||
}
|
||||
|
||||
// 过滤传入Form组件的属性
|
||||
|
||||
0
src/components/Form/src/components/Checkbox.vue
Normal file
0
src/components/Form/src/components/Checkbox.vue
Normal file
0
src/components/Form/src/components/Radio.vue
Normal file
0
src/components/Form/src/components/Radio.vue
Normal file
0
src/components/Form/src/components/Select.vue
Normal file
0
src/components/Form/src/components/Select.vue
Normal file
@@ -1,6 +1,5 @@
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const { t } = useI18n()
|
||||
console.log(t)
|
||||
|
||||
interface PlaceholderMoel {
|
||||
placeholder?: string
|
||||
@@ -15,11 +14,9 @@ interface PlaceholderMoel {
|
||||
* @description 用于自动设置placeholder
|
||||
*/
|
||||
export function setTextPlaceholder(schema: VFormSchema): PlaceholderMoel {
|
||||
console.log(schema)
|
||||
const textMap = ['Input', 'Autocomplete', 'InputNumber']
|
||||
const selectMap = ['Select', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect']
|
||||
if (textMap.includes(schema?.component as string)) {
|
||||
console.log(t('common.inputText'))
|
||||
return {
|
||||
placeholder: t('common.inputText')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user