diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 71ff14a..343a3a7 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -9,9 +9,13 @@ import 'echarts/lib/component/dataZoom' const chartRef = ref() const props = defineProps(['options']) -let chart: echarts.ECharts | null = null +let chart: echarts.ECharts | any = null const resizeHandler = () => { - chart?.resize() + chart.getZr().painter.getViewportRoot().style.display = "none"; + requestAnimationFrame(() => { + chart.resize() + chart.getZr().painter.getViewportRoot().style.display = ""; + }) } const initChart = () => { chart?.dispose() @@ -88,7 +92,6 @@ const initChart = () => { ], yAxis: [ { - type: 'value', nameTextStyle: { @@ -148,9 +151,7 @@ const initChart = () => { }) } onMounted(() => { - setTimeout(() => { - // initChart() - }, 20) + initChart() window.addEventListener('resize', resizeHandler) }) defineExpose({ initChart }) diff --git a/src/components/table/defaultAttribute.ts b/src/components/table/defaultAttribute.ts new file mode 100644 index 0000000..0761d93 --- /dev/null +++ b/src/components/table/defaultAttribute.ts @@ -0,0 +1,11 @@ +export const defaultAttribute = { + align: 'center', + class: 'ba-data-table w100', + headerCellClassName: 'table-header-cell', + border: true, + stripe: true, + size: 'small', + columnConfig: { resizable: true }, + rowConfig: { isCurrent: true, isHover: true }, + scrollX: { scrollToLeftOnChange: true }, +} \ No newline at end of file diff --git a/src/components/table/index.vue b/src/components/table/index.vue index ef688ce..8aa4b9c 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -1,18 +1,9 @@