Files
admin-sjzx/src/components/table/column/index.vue
仲么了 361cbb713d first
2024-02-19 13:44:32 +08:00

24 lines
646 B
Vue

<script lang='ts'>
import { defineComponent, createVNode, reactive } from 'vue'
import { Column } from 'vxe-table'
import { uuid } from '@/utils/random'
export default defineComponent({
name: 'Column',
props: {
attr: {
type: Object,
required: true
}
},
setup(props, { slots }) {
const attr = reactive(props.attr)
attr['align'] = attr['align'] ? attr['align'] : 'center'
attr['column-key'] = attr['column-key'] ? attr['column-key'] : attr.prop || uuid()
return () => {
return createVNode(Column, attr, slots.default)
}
}
})
</script>