fix: 修复option禁用属性无效

style: input默认宽度与select对齐
This commit is contained in:
kailong321200875
2022-11-07 15:09:16 +08:00
parent 73ecc98671
commit 0b671e914e
6 changed files with 51 additions and 29 deletions

View File

@@ -50,6 +50,7 @@ watch(
)
const dialogStyle = computed(() => {
console.log(unref(dialogHeight))
return {
height: unref(dialogHeight)
}

View File

@@ -226,6 +226,11 @@ 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 }
}
{...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options
? { options: item?.componentProps?.options || [] }

View File

@@ -11,7 +11,12 @@ export const useRenderCheckbox = () => {
typeof defineComponent
>
return item?.componentProps?.options?.map((option) => {
return <Com label={option[labelAlias || 'value']}>{option[valueAlias || 'label']}</Com>
const { value, ...other } = option
return (
<Com label={option[labelAlias || 'value']} {...other}>
{option[valueAlias || 'label']}
</Com>
)
})
}

View File

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

View File

@@ -456,6 +456,7 @@ const schema = reactive<FormSchema[]>([
componentProps: {
options: [
{
disabled: true,
label: 'option1',
value: '1'
},
@@ -494,6 +495,7 @@ const schema = reactive<FormSchema[]>([
label: 'option1',
options: [
{
disabled: true,
label: 'option1-1',
value: '1-1'
},
@@ -757,6 +759,7 @@ const schema = reactive<FormSchema[]>([
componentProps: {
options: [
{
disabled: true,
label: 'option-1',
value: '1'
},
@@ -774,6 +777,7 @@ const schema = reactive<FormSchema[]>([
componentProps: {
options: [
{
disabled: true,
label: 'option-1',
value: '1'
},
@@ -797,6 +801,7 @@ const schema = reactive<FormSchema[]>([
componentProps: {
options: [
{
disabled: true,
label: 'option-1',
value: '1'
},
@@ -819,6 +824,7 @@ const schema = reactive<FormSchema[]>([
componentProps: {
options: [
{
disabled: true,
label: 'option-1',
value: '1'
},