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",
"version": "1.6.4.1841",
"version": "1.6.4.1851",
"description": "基于vue3、vite3、element-plus、typesScript",
"author": "xingyu",
"private": false,

View File

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

View File

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

View File

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

View File

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