feat(baInput):单复选框支持按钮模式

This commit is contained in:
Lysander 2024-04-17 15:50:07 +08:00
parent efa1d7f514
commit eab132609a
2 changed files with 4 additions and 1 deletions

View File

@ -164,6 +164,8 @@ export interface InputAttr {
valueTitle?: string
// 返回数据类型
dataType?: string
// 是否渲染为 buttonradio 和 checkbox
button?: boolean
// 事件
onPreview?: Function
onRemove?: Function

View File

@ -62,10 +62,11 @@ export default defineComponent({
console.warn('请传递 ' + props.type + '的 content')
}
let vNode: VNode[] = []
const type = props.attr.button ? props.type + '-button' : props.type
for (const key in props.data.content) {
vNode.push(
createVNode(
resolveComponent('el-' + props.type),
resolveComponent('el-' + type),
{
label: key,
...childrenAttr,