import './index.less' import { DownOutlined, EllipsisOutlined } from '@ant-design/icons-vue' import type { MenuItemProps } from 'ant-design-vue' import { Dropdown, Menu, Button } from 'ant-design-vue' import type { VueNode } from '../../../types' import type { CSSProperties, FunctionalComponent } from 'vue' import { getPrefixCls } from '../../../layout/RouteContext' interface MenuItems extends MenuItemProps { name: VueNode key: string title?: string } export type DropdownProps = { menus?: MenuItems[] onSelect?: (key: string) => void } /** * 一个简单的下拉菜单 */ const DropdownButton: FunctionalComponent = ( { menus, onSelect }, { attrs, slots } ) => { const tempClassName = getPrefixCls('pro-table-dropdown') const menu = ( onSelect && onSelect(params.key as string)}> {menus?.map(item => ( {item.name} ))} ) return ( ) } const TableDropdown: FunctionalComponent & { Button: typeof DropdownButton } = ({ onSelect, menus = [] }, { attrs, slots }) => { const className = getPrefixCls('pro-table-dropdown') const menu = ( { onSelect?.(params.key as string) }} > {menus.map(({ key, name, ...rest }) => ( {name} ))} ) return ( {slots.default?.() || } ) } TableDropdown.Button = DropdownButton export default TableDropdown