+
@@ -11,7 +11,14 @@
diff --git a/src/view/echarts_yl/eP2_2.vue b/src/view/echarts_yl/eP2_2.vue
index b346ad0..b3ef77f 100644
--- a/src/view/echarts_yl/eP2_2.vue
+++ b/src/view/echarts_yl/eP2_2.vue
@@ -214,11 +214,12 @@ const getOption = () => {
};
const setChart = () => {
- // Vue3中: 需要引入
- var myChart = echarts.init(chart.value);
-
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(data.option);
+ if (chart.value) {
+ const myChart = echarts.init(chart.value);
+ myChart.setOption(data.option);
+ } else {
+ // console.error('chart is not defined');
+ }
};
// 使用生命钩子
diff --git a/src/view/echarts_yl/eP3_2.vue b/src/view/echarts_yl/eP3_2.vue
index b3da1a6..23aed97 100644
--- a/src/view/echarts_yl/eP3_2.vue
+++ b/src/view/echarts_yl/eP3_2.vue
@@ -365,11 +365,12 @@ const getOption = () => {
};
};
const setChart = () => {
- // Vue3中: 需要引入
- var myChart = echarts.init(chart.value);
-
- // 使用刚指定的配置项和数据显示图表。
- myChart.setOption(data.option);
+ if (chart.value) {
+ const myChart = echarts.init(chart.value);
+ myChart.setOption(data.option);
+ } else {
+ // console.error('chart is not defined');
+ }
};
// 使用生命钩子
diff --git a/src/view/echarts_yl/pie.vue b/src/view/echarts_yl/pie.vue
index 024c6d6..493f462 100644
--- a/src/view/echarts_yl/pie.vue
+++ b/src/view/echarts_yl/pie.vue
@@ -253,7 +253,6 @@ const getOption = () => {
const setChart = () => {
// Vue3中: 需要引入
var myChart = echarts.init(chart.value);
-
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(data.option);
};
diff --git a/src/view/echarts_yl/pie2.vue b/src/view/echarts_yl/pie2.vue
index e298927..9eef877 100644
--- a/src/view/echarts_yl/pie2.vue
+++ b/src/view/echarts_yl/pie2.vue
@@ -2,7 +2,7 @@
-
-
\ No newline at end of file
+
diff --git a/src/view/echarts_yl/ylSMFW.vue b/src/view/echarts_yl/ylSMFW.vue
index 4a8253f..07b04f7 100644
--- a/src/view/echarts_yl/ylSMFW.vue
+++ b/src/view/echarts_yl/ylSMFW.vue
@@ -1,5 +1,5 @@
-
+