chore: update 1.8.5

pull/2/head
xingyu4j 2022-11-17 13:14:27 +08:00
parent d4d6f667aa
commit 2de05a87f4
5 changed files with 11 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ruoyi-vue-pro-vue3", "name": "ruoyi-vue-pro-vue3",
"version": "1.6.4.1841", "version": "1.6.4.1851",
"description": "基于vue3、vite3、element-plus、typesScript", "description": "基于vue3、vite3、element-plus、typesScript",
"author": "xingyu", "author": "xingyu",
"private": false, "private": false,

View File

@ -226,11 +226,7 @@ export default defineComponent({
vModel={formModel.value[item.field]} vModel={formModel.value[item.field]}
{...(autoSetPlaceholder && setTextPlaceholder(item))} {...(autoSetPlaceholder && setTextPlaceholder(item))}
{...setComponentProps(item)} {...setComponentProps(item)}
style={ style={item.componentProps?.style}
item?.component === 'Input'
? { width: '189.5px', ...item.componentProps?.style }
: { ...item.componentProps?.style }
}
{...(notRenderOptions.includes(item?.component as string) && {...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options item?.componentProps?.options
? { options: item?.componentProps?.options || [] } ? { options: item?.componentProps?.options || [] }
@ -258,8 +254,8 @@ export default defineComponent({
return renderRadioOptions(item) return renderRadioOptions(item)
case 'Checkbox': case 'Checkbox':
case 'CheckboxButton': case 'CheckboxButton':
const { renderChcekboxOptions } = useRenderCheckbox() const { renderCheckboxOptions } = useRenderCheckbox()
return renderChcekboxOptions(item) return renderCheckboxOptions(item)
default: default:
break break
} }

View File

@ -3,7 +3,7 @@ import { ElCheckbox, ElCheckboxButton } from 'element-plus'
import { defineComponent } from 'vue' import { defineComponent } from 'vue'
export const useRenderCheckbox = () => { export const useRenderCheckbox = () => {
const renderChcekboxOptions = (item: FormSchema) => { const renderCheckboxOptions = (item: FormSchema) => {
// 如果有别名,就取别名 // 如果有别名,就取别名
const labelAlias = item?.componentProps?.optionsAlias?.labelField const labelAlias = item?.componentProps?.optionsAlias?.labelField
const valueAlias = item?.componentProps?.optionsAlias?.valueField const valueAlias = item?.componentProps?.optionsAlias?.valueField
@ -13,14 +13,14 @@ export const useRenderCheckbox = () => {
return item?.componentProps?.options?.map((option) => { return item?.componentProps?.options?.map((option) => {
const { ...other } = option const { ...other } = option
return ( return (
<Com label={option[labelAlias || 'value']} {...other}> <Com {...other} label={option[valueAlias || 'value']}>
{option[valueAlias || 'label']} {option[labelAlias || 'label']}
</Com> </Com>
) )
}) })
} }
return { return {
renderChcekboxOptions renderCheckboxOptions
} }
} }

View File

@ -13,8 +13,8 @@ export const useRenderRadio = () => {
return item?.componentProps?.options?.map((option) => { return item?.componentProps?.options?.map((option) => {
const { ...other } = option const { ...other } = option
return ( return (
<Com label={option[labelAlias || 'value']} {...other}> <Com {...other} label={option[valueAlias || 'value']}>
{option[valueAlias || 'label']} {option[labelAlias || 'label']}
</Com> </Com>
) )
}) })

View File

@ -36,9 +36,9 @@ export const useRenderSelect = (slots: Slots) => {
return ( return (
<ElOption <ElOption
{...other}
label={labelAlias ? option[labelAlias] : label} label={labelAlias ? option[labelAlias] : label}
value={valueAlias ? option[valueAlias] : value} value={valueAlias ? option[valueAlias] : value}
{...other}
> >
{{ {{
default: () => default: () =>