浏览代码

feat:echarts-交互

ananzhusen 7 月之前
父节点
当前提交
8719cddd62
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      src/views/components/PenEvents.vue

+ 11 - 0
src/views/components/PenEvents.vue

@@ -13,6 +13,7 @@
               <t-select
                 v-model="item.name"
                 style="width: 40%"
+                @change="eventNameChange"
                 :options="options"
                 autoWidth
               />
@@ -78,6 +79,7 @@ import { onBeforeMount, onUnmounted, ref, computed } from 'vue';
 import Actions from './Actions.vue';
 import Conditions from './Conditions.vue';
 import { DeleteIcon } from 'tdesign-icons-vue-next';
+import { initEvent } from '@meta2d/chart-diagram';
 
 const props = defineProps<{
   pen: any;
@@ -239,8 +241,17 @@ const addEvent = (e: any) => {
     props.pen.events = [];
   }
   props.pen.events.push({ name: e.value });
+  if(props.pen.name === 'echarts'){
+    initEvent(props.pen);
+  }
 };
 
+const eventNameChange = ()=>{
+  if(props.pen.name === 'echarts'){
+    initEvent(props.pen);
+  }
+}
+
 onUnmounted(() => {});
 </script>
 <style lang="postcss" scoped>