import Vue from 'vue'
import {
    Button,
    Message,
    Menu,
    Icon,
    Input,
    Tabs,
    Pagination,
    Popover,
    Table,
    Divider,
    ConfigProvider,
    Alert,
    Badge,
    Tooltip,
    Form,
    Modal,
    Select,
    InputNumber,
    Radio,
    Tree,
    Upload,
    Steps,
    Row,
    Col,
    Transfer,
    Drawer,
    Checkbox,
    Layout,
    Spin,
    Empty,
    List,
    Affix,
    Dropdown,
    Result,
    TreeSelect
} from 'ant-design-vue';
let useObj = {
    Button,
    Menu,
    Icon,
    Input,
    Tabs,
    Pagination,
    Popover,
    Table,
    Divider,
    ConfigProvider,
    Alert,
    Badge,
    Tooltip,
    Form,
    Modal,
    Select,
    InputNumber,
    Radio,
    Tree,
    Upload,
    Steps,
    Row,
    Col,
    Transfer,
    Drawer,
    Checkbox,
    Layout,
    Spin,
    Empty,
    List,
    Affix,
    Dropdown,
    Result,
    TreeSelect
}
//这里放挂载方法
let prototypeObj = {
    Message,
}
function VueComponent() {
    for (let x in useObj) {
        Vue.use(useObj[x]);
    }

}
function VuePrototype() {
    for (let x in prototypeObj) {
        //将首字母转化为小写
        let str = x.slice(0, 1).toLowerCase() + x.slice(1)
        //挂载到Vue原型上
        Vue.prototype[`$${str}`] = prototypeObj[x];
    }

}
function VueModalPrototype() {
    Vue.prototype.$confirm = Modal.confirm;
}
export function antdFunction() {
    VueComponent()
    VuePrototype()
    VueModalPrototype()
}