ams icon indicating copy to clipboard operation
ams copied to clipboard

配置属性的命名统一为横杠的格式

Open w3cmark opened this issue 4 years ago • 0 comments

针对ams自定义的配置属性,到底是用驼峰还是横杠?

比如resource里的fields在配置label宽度配置和block-form的label宽度配置不一致

目前配置:

const config = {
    type: 'form',
    resource: {
        fields: {
            switchFieldB: {
                labelWidth: '0'
            }
        }
    },
    props: {
        'label-width': '0'
    }
}

解决方案:

建议和element保持一致,统一用横杠

const config = {
    type: 'form',
    resource: {
        fields: {
            switchFieldB: {
                attrs: {
                    'label-width': '0'
                }
            }
        }
    },
    attrs: {
        'label-width': '0'
    }
}

w3cmark avatar Dec 22 '19 14:12 w3cmark