import { App } from "vue";
import { EditOutlined, MenuOutlined, LeftOutlined, DownOutlined, MenuFoldOutlined, MenuUnfoldOutlined, AppstoreOutlined, CloseOutlined } from "@ant-design/icons-vue";
import { Dropdown, Empty, Badge, Button, Divider, Input, Menu, Modal, Popconfirm, Select, Tabs } from "ant-design-vue";

/**
 * @description: 注册antdv组件
 * @author ChenRui
 * @date 2022/5/23 19:42
 */
class AntdVueService {
  icons: any = { EditOutlined, MenuOutlined, LeftOutlined, DownOutlined, MenuFoldOutlined, MenuUnfoldOutlined, AppstoreOutlined, CloseOutlined };

  install = (app: App, ...options: any[]) => {
    app.use(Dropdown);
    app.use(Input);
    app.use(Select);
    app.use(Modal);
    app.use(Menu);
    app.use(Button);
    app.use(Tabs);
    app.use(Divider);
    app.use(Badge);
    app.use(Popconfirm);
    app.use(Empty);

    Object.keys(this.icons).forEach((key: string) => {
      app.component(key, this.icons[key]);
    });
  };
}
const antdVueService = new AntdVueService();
export default antdVueService;
