UNPKG

vxe-design

Version:

A PC-based visual designer based on Vxe UI, used for building zero-code and low-code platforms

39 lines (38 loc) 1.06 kB
import { ref, h, reactive } from 'vue'; import { defineVxeComponent } from '../../ui/src/comp'; import XEUtils from 'xe-utils'; export default defineVxeComponent({ name: 'VxeFlowView', props: {}, emits: [], setup(props, context) { const { slots } = context; const xID = XEUtils.uniqueId(); const refElem = ref(); const reactData = reactive({}); const refMaps = { refElem }; const computeMaps = {}; const $xeFlowView = { xID, props, context, reactData, getRefMaps: () => refMaps, getComputeMaps: () => computeMaps }; const renderVN = () => { const defaultSlot = slots.default; return h('div', { ref: refElem, class: ['vxe-flow-view'] }, defaultSlot ? defaultSlot({}) : []); }; $xeFlowView.renderVN = renderVN; return $xeFlowView; }, render() { return this.renderVN(); } });