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

@ -28,71 +28,71 @@
},
"dependencies": {
"@iconify/iconify": "^3.0.0",
"@vueuse/core": "^9.3.0",
"@wangeditor/editor": "^5.1.20",
"@vueuse/core": "^9.4.0",
"@wangeditor/editor": "^5.1.22",
"@wangeditor/editor-for-vue": "^5.1.10",
"@zxcvbn-ts/core": "^2.0.5",
"@zxcvbn-ts/core": "^2.1.0",
"animate.css": "^4.1.1",
"axios": "^0.27.2",
"axios": "^1.1.3",
"echarts": "^5.4.0",
"echarts-wordcloud": "^2.0.0",
"element-plus": "2.2.17",
"element-plus": "2.2.20",
"intro.js": "^6.0.0",
"lodash-es": "^4.17.21",
"mitt": "^3.0.0",
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.22",
"pinia": "^2.0.23",
"qrcode": "^1.5.1",
"qs": "^6.11.0",
"url": "^0.11.0",
"vue": "3.2.40",
"vue": "3.2.41",
"vue-i18n": "9.2.2",
"vue-router": "^4.1.5",
"vue-router": "^4.1.6",
"vue-types": "^4.2.1",
"web-storage-cache": "^1.1.1"
},
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@iconify/json": "^2.1.115",
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@iconify/json": "^2.1.134",
"@intlify/vite-plugin-vue-i18n": "^6.0.3",
"@purge-icons/generated": "^0.9.0",
"@types/intro.js": "^5.1.0",
"@types/lodash-es": "^4.17.6",
"@types/node": "^18.7.23",
"@types/node": "^18.11.9",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.5.0",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@vitejs/plugin-vue": "^3.1.0",
"@vitejs/plugin-vue-jsx": "^2.0.1",
"autoprefixer": "^10.4.12",
"eslint": "^8.24.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.27.0",
"eslint-config-prettier": "^8.5.0",
"eslint-define-config": "^1.7.0",
"eslint-define-config": "^1.11.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.5.1",
"eslint-plugin-vue": "^9.7.0",
"husky": "^8.0.1",
"less": "^4.1.3",
"lint-staged": "^13.0.3",
"plop": "^3.1.1",
"postcss": "^8.4.16",
"postcss": "^8.4.18",
"postcss-html": "^1.5.0",
"postcss-less": "^6.0.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"stylelint": "^14.13.0",
"rollup": "^3.2.5",
"stylelint": "^14.14.1",
"stylelint-config-html": "^1.1.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^9.0.0",
"stylelint-config-standard": "^28.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-order": "^5.0.0",
"typescript": "4.8.4",
"unplugin-vue-macros": "^0.11.2",
"vite": "3.1.4",
"unplugin-vue-macros": "^0.16.0",
"vite": "3.2.2",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6",
@ -100,7 +100,7 @@
"vite-plugin-style-import": "2.0.0",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-windicss": "^1.8.8",
"vue-tsc": "^0.40.13",
"vue-tsc": "^1.0.9",
"windicss": "^3.5.6",
"windicss-analysis": "^0.3.5"
},

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'
},