From 34e04a7b9877c136b98993f2f8e85c027107df4c Mon Sep 17 00:00:00 2001
From: Yue JIN
Date: Mon, 2 Jun 2025 21:33:25 +0800
Subject: [PATCH 01/27] feat: experimental component rendered tooltip
---
demo/Demo.vue | 2 +
demo/examples/LineChart.vue | 106 ++++++++++++++++++++++++++++++++++++
src/ECharts.ts | 37 ++++++++++---
3 files changed, 137 insertions(+), 8 deletions(-)
create mode 100644 demo/examples/LineChart.vue
diff --git a/demo/Demo.vue b/demo/Demo.vue
index 9270f02..9e33e98 100644
--- a/demo/Demo.vue
+++ b/demo/Demo.vue
@@ -8,6 +8,7 @@ import { track } from "@vercel/analytics";
import LogoChart from "./examples/LogoChart.vue";
import BarChart from "./examples/BarChart.vue";
+import LineChart from "./examples/LineChart.vue";
import PieChart from "./examples/PieChart.vue";
import PolarChart from "./examples/PolarChart.vue";
import ScatterChart from "./examples/ScatterChart.vue";
@@ -74,6 +75,7 @@ watch(codeOpen, (open) => {
+
diff --git a/demo/examples/LineChart.vue b/demo/examples/LineChart.vue
new file mode 100644
index 0000000..c60ba6d
--- /dev/null
+++ b/demo/examples/LineChart.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ECharts.ts b/src/ECharts.ts
index 66e2646..b87ac6e 100644
--- a/src/ECharts.ts
+++ b/src/ECharts.ts
@@ -24,7 +24,7 @@ import {
import { isOn, omitOn, toValue } from "./utils";
import { register, TAG_NAME } from "./wc";
-import type { PropType, InjectionKey } from "vue";
+import type { PropType, InjectionKey, SlotsType } from "vue";
import type {
EChartsType,
SetOptionType,
@@ -65,7 +65,10 @@ export default defineComponent({
},
emits: {} as unknown as Emits,
inheritAttrs: false,
- setup(props, { attrs, expose }) {
+ slots: Object as SlotsType<{
+ tooltip: { params: any; show: boolean };
+ }>,
+ setup(props, { attrs, expose, slots }) {
const root = shallowRef();
const chart = shallowRef();
const manualOption = shallowRef