import { importAll } from '@/utils/utils';
const components = importAll(require.context('@/components/', true,  /\.vue$/ ));
import {
    Tab,
    Tabs,
    Search,
    RadioGroup,
    Radio,
    DatetimePicker,
    Picker,
    Uploader,
    Steps,
    Step,
    List,
    Image,
    Empty,
    Field,
    Dialog,
    GridItem,
    Grid,
    Button,
    Popup,
    NavBar,
    SwipeCell,
} from 'vant';
export default {
    install(Vue: any) {
        Vue.component(Button.name, Button);
        Vue.component(Dialog.Component.name, Dialog.Component);
        Vue.component(DatetimePicker.name, DatetimePicker);
        Vue.component(Empty.name, Empty);
        Vue.component(Field.name, Field);
        Vue.component(GridItem.name, GridItem);
        Vue.component(Grid.name, Grid);
        Vue.component(Image.name, Image);
        Vue.component(List.name, List);
        Vue.component(NavBar.name, NavBar);
        Vue.component(Picker.name, Picker);
        Vue.component(Popup.name, Popup);

        Vue.component(RadioGroup.name, RadioGroup);
        Vue.component(Radio.name, Radio);

        Vue.component(Search.name, Search);
        Vue.component(Steps.name, Steps);
        Vue.component(Step.name, Step);
        Vue.component(Tabs.name, Tabs);
        Vue.component(Tab.name, Tab);
        Vue.component(SwipeCell.name, SwipeCell);
        Vue.component(Uploader.name, Uploader);
        Object.keys(components).forEach((key: string) => {
            Vue.component(key, components[key]);
        });
    },
};
