Commit d1c4cc93 by luyt

feat:添加gltablebutton中attrs的属性为函数的情况,传入该项和配置

1 parent ebe9c475
......@@ -22,8 +22,7 @@ export default {
}
},
data() {
return {
}
return {}
},
render() {
/**
......@@ -86,12 +85,18 @@ export default {
// //1.筛选过滤条件
const componentList = this.buttonList
.map(item => {
//处理disabled情况(函数或者boolean)
//处理attrs中属性为函数情况
item = deepcopy(item)
if(objectType(item.attrs.disabled) === 'Function'){
item.attrs.disabled = item.attrs.disabled(this.buttonItem, item)
let attrKeys = item.attrs ? Object.keys(item.attrs) : 0
if (attrKeys.length > 0) {
for (let key of attrKeys) {
if (objectType(item.attrs[key]) === 'Function') {
item.attrs[key] = item.attrs[key](this.buttonItem, item)
}
}
}
//不传条件,默认显示
if (!item.condition) {
return item
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!