智感-弹窗关闭按钮增加单击事件

main
滕嵩 2025-02-21 10:18:23 +08:00
parent e57d9e51d4
commit 493d5b6cde
1 changed files with 19 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="ModalFrameClose">
<n-button text>
<n-button text @click="clickBtn">
<Button :w="w" :h="h" :dataStyle="option.dataStyle" />
</n-button>
</div>
@ -12,8 +12,10 @@
import { icon } from '@/plugins';
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
import { useChartDataFetch } from '@/hooks';
import { eventHandlerHook } from '@/hooks/eventHandler.hook';
import Button from './svg/button.vue';
const chartEditStore = useChartEditStore();
const props = defineProps({
chartConfig: {
type: Object as PropType<CreateComponentType>,
@ -22,10 +24,25 @@
});
const { w, h } = toRefs(props.chartConfig.attr);
const option = reactive({
dataStyle: props.chartConfig.option.dataStyle,
});
//
const clickElementItem = ref([]);
const list = props.chartConfig.events.interactConfigEvents;
for (let i = 0; i < list.length; i++) {
if (list[i].type == 'click') {
for (let j = 0; j < list[i].movementList.length; j++) {
clickElementItem.value.push(list[i].movementList[j]);
}
}
}
const clickBtn = () => {
eventHandlerHook(chartEditStore.getComponentList, clickElementItem.value);
};
</script>
<style lang="scss" scoped>