UNPKG

@dfsj/echarts

Version:

专业的水文曲线组件或构造函数以及通用的echart二次封装图表

49 lines (45 loc) 1.13 kB
/** * * @dfsj/echarts: 专业的水文曲线组件或构造函数以及通用的echart二次封装图表 * 版本: v3.7.0-alpha.5 * 作者:yangbo <1747837358@qq.com> * 日期:2025-11-21 13:30:34 * * */ import { shallowReactive, watch } from 'vue'; import { createComponent } from './createComponent.js'; import './Table.vue.js'; import script from './Table.vue2.js'; function useTable() { var props = shallowReactive({ value: null, chart: null, visible: false, container: null }); var _createComponent = createComponent(script, props), close = _createComponent.close, open = _createComponent.open; var toggleTable = function toggleTable(visible) { if (visible !== undefined) { props.visible = visible; } else { props.visible = !props.visible; } }; watch(function () { return props.visible; }, function (value, oldValue, onCleanup) { value ? open() : close(); }, { immediate: true }); return { close: close, open: open, props: props, toggleTable: toggleTable }; } export { useTable };