import { IconMore } from "@queenjs/icons"
import { Dropdown, Menu} from "ant-design-vue"
import { defineComponent} from "vue"
import { array } from "vue-types"
export default defineComponent({
    props: {
        items: array<string>().isRequired
    },
    emits:["menu"],
    setup(props, {emit}) {
        return ()=>(
            <Dropdown
                placement="bottom"
                overlay={
                  <Menu class="w-90px">

                    {
                         props.items.map(item=>(
                            <Menu.Item key={item}>
                                <div onClick={() =>{ 
                                    emit("menu", item)
                                }}>{item}</div>
                          </Menu.Item>
                         ))
                    }
                  </Menu>
                }
              >
                <IconMore class="ml-10px text-22px cursor-pointer" />
            </Dropdown>
        )
    },
})