com-serp-common-components
Version:
``` formJson: { inline: false, // 是否inline展示 labelPosition: "right", // 标题位置(左,右,居中) labelWidth: "", // 标题宽度 (可在单行上定义) statusIcon: true, formItemList: [ // 表单配置项 { type: "slot", slotName: "upload", label: "上传", // 中文名或标题 pro
32 lines (31 loc) • 771 B
JavaScript
export default {
methods: {
validator (parent, prop = [], type) {
let value = null
let key = type ? 'checkErrorValue' : 'checkValue'
parent.map(child => {
if (child.prop && child[key]) {
if (prop.length) {
if (prop.indexOf(child.prop) !== -1) {
if (value) {
child[key]()
} else {
value = child[key]()
}
}
} else {
if (value) {
child[key]()
} else {
value = child[key]()
if (value) {
child.$el.getElementsByClassName('el-input__inner')[0].focus()
}
}
}
}
})
return value
},
}
}