<script setup lang="ts">
import { HJNodeType } from '../../types/comTypes';
import {
    Plus,
} from '@element-plus/icons-vue'
import { ArrowDown } from '@element-plus/icons-vue'

const emits = defineEmits(['addNode']);

const options = [
  { content: '数字输入', value: HJNodeType.numberInput },
  { content: '数字计算', value: HJNodeType.numberFunction },
  { content: '数字输出', value: HJNodeType.numberResult },
];

const clickHandler = (data) => {
  console.log('clickHandler');
  emits('addNode', data.value);
};

const changeHandler = (data) => {
  console.log('changeHandler');
//   这个不起作用 也不打印 不知道为什么

}

</script>

<template>
  <el-dropdown  @click="clickHandler" >
    <el-button type="primary" :icon="Plus" circle />
    <template #dropdown>
      <el-dropdown-menu @change="changeHandler">
        <el-dropdown-item>Action 1</el-dropdown-item>
        <el-dropdown-item>Action 2</el-dropdown-item>
        <el-dropdown-item>Action 3</el-dropdown-item>
        <el-dropdown-item>Action 4</el-dropdown-item>
        <el-dropdown-item>Action 5</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<style scoped lang="less"></style>
