init
This commit is contained in:
24
src/components/treeGrid/component/renderCol.vue
Normal file
24
src/components/treeGrid/component/renderCol.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'RenderCol',
|
||||
props: {
|
||||
col: {
|
||||
type: Function,
|
||||
required: true
|
||||
},
|
||||
param: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
try {
|
||||
const content = this.col(h, this.param)
|
||||
return <div class="text-center">{content}</div>
|
||||
} catch (e) {
|
||||
// 渲染失败时提供一个容错显示
|
||||
return <div class="text-center">-</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user