| | |
| | | size="mini" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :icon="o.icon | iconFn(scope.row, o)" |
| | | :icon="iconFn(o)" |
| | | :plain="o.plain" |
| | | :style="{ 'color': o.name === '删除' ? '#f56c6c' : o.color }" |
| | | :type="o.type | typeFn(scope.row)" |
| | |
| | | export default { |
| | | name: 'ZTTable', |
| | | filters: { |
| | | iconFn(val, row) { |
| | | if (typeof (val) === 'function') { |
| | | return val(row); |
| | | } else return val; |
| | | }, |
| | | typeFn(val, row) { |
| | | // console.log(val, row, '11111111'); |
| | | if (typeof (val) === 'function') { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | iconFn(row) { |
| | | if (row.name === '编辑') { |
| | | return 'el-icon-edit' |
| | | } else if (row.name === '删除') { |
| | | return 'el-icon-delete' |
| | | } else if (row.name === '查看') { |
| | | return 'el-icon-view' |
| | | } else { |
| | | return row.icon |
| | | } |
| | | // if (typeof (val) === 'function') { |
| | | // return val(row); |
| | | // } else return val; |
| | | }, |
| | | formatType(val, format) { |
| | | if (typeof (format) === 'function') { |
| | | return format(val); |