import Vue from 'vue'
import {
  Toast,
  Swipe,
  SwipeItem,
  Loading,
  Overlay,
  Popup,
  Tabbar,
  TabbarItem,
  Lazyload,
  Button,
  List,
  Dialog,
  Sticky,
  CountDown,
  NoticeBar,
  NavBar,
  Icon,
  PullRefresh,
  Tab,
  Tabs
} from 'vant'
import errorImg from '@/assets/images/lazyLoad/error.png'
import loadingImg from '@/assets/images/lazyLoad/loading.png'

/* 提醒 */
Vue.use(Toast)
Vue.prototype.$toast = Toast

/* 轮播 */
Vue.use(Swipe)
Vue.use(SwipeItem)

/* loading */
Vue.use(Loading)

/* 弹出层 */
Vue.use(Overlay)
Vue.use(Popup)

/* 底部导航条 */
Vue.use(Tabbar)
Vue.use(TabbarItem)

/* 懒加载 */
Vue.use(Lazyload, {
  lazyComponent: true,
  loading: loadingImg,
  error: errorImg
})

/* 按钮 */
Vue.use(Button)

/* 列表 */
Vue.use(List)

/* 弹窗 */
Vue.use(Dialog)
Vue.prototype.$dialog = Dialog

/* 吸顶 */
Vue.use(Sticky)

/* 倒计时 */
Vue.use(CountDown)

/* 提示条（可滚动） */
Vue.use(NoticeBar)

/* 标题栏 */
Vue.use(NavBar)

/* 图标 */
Vue.use(Icon)

/* 下拉刷新 */
Vue.use(PullRefresh)

/* 标签页 */
Vue.use(Tab);
Vue.use(Tabs);
