UNPKG

magiccube-vue3

Version:

vue3-js版组件库

31 lines (27 loc) 667 B
import { h } from 'vue' const DEFAULT_SCOPE_DATA = { rowIndex: null, columnIndex: null, data: {} } const TableColumn = { name: 'McTableV2Column', props: { label: String, width: [String, Number], align: { type: String, default: 'left' }, keyName: String, headerTip: String, headerTipWidth: [String, Number], }, setup(props, { slots, attrs }) { const store = attrs.store || DEFAULT_SCOPE_DATA return () => h('div', [ slots.default?.(store) || store.data?.[props.keyName || ''] || '', ]) } } export default TableColumn