vxe-table-select-area
Version:
一个基于 vxe-table 的可区域选中复制、粘贴的组件
49 lines (48 loc) • 1.42 kB
JavaScript
import { EMIT_EVENTS } from '../../select-area/common/constant'
import { clsName } from '../../select-area/common'
export default {
name: 'VxeSelectAreaDom',
props: {
// value: Boolean,
// icon: String,
// text: String,
// domRect: Object
},
mounted () {
const _this = this.$parent.$parent
_this.$on(EMIT_EVENTS.CELL_SELECTION_RANGE_DATA_CHANGE, (newData) => {
_this.cellSelectionRangeDataChange(newData)
})
},
// methods: {
// },
render (h) {
const _this = this.$parent.$parent
// middle
const middleSelectionCurrent = _this.getSelectionCurrent({
fixedType: ''
})
const middleSelectionArea = _this.getSelectionAreas({
fixedType: ''
})
const middleAutoFillArea =
middleSelectionCurrent.autoFillArea ||
middleSelectionArea.autoFillArea
// console.log(middleSelectionArea)
return h('div', {
class: clsName('selection-wrapper'),
style: { visibility: this.isCellEditing ? 'hidden' : '' }
}, [h('div', {
class: clsName('selection-fixed-left')
}, []), h('div', {
class: clsName('selection-middle')
}, [
middleSelectionCurrent.selectionCurrent,
middleSelectionArea.normalArea,
middleAutoFillArea,
middleSelectionArea.normalAreaLayer
]), h('div', {
class: clsName('selection-fixed-right')
})])
}
}