/* 由'./build/bin/build-comps-index.js' 自动生成*/
import Iview from 'iview';
import 'iview/dist/styles/iview.css';
import BlockComponents from '@tydic-group/component-block';
import '@tydic-group/component-block/dist/themes/default/index.less';
import PageDataShow from './components/page-data-show/index.js';
import PageDataShowDemo from './components/page-data-show-demo/index.js';
import PageOperateDetail from './components/page-operate-detail/index.js';
import PageOperateDetailDemo from './components/page-operate-detail-demo/index.js';
import PageOperateModal from './components/page-operate-modal/index.js';
import PageOperateModalDemo from './components/page-operate-modal-demo/index.js';
import PageOperateModal2Demo from './components/page-operate-modal2-demo/index.js';

 //工具函数从这里引入,和声明
 //import VcUtils from './libs/utils'
 //window.VcUtils = VcUtils

const components = [
  PageDataShow,
  PageDataShowDemo,
  PageOperateDetail,
  PageOperateDetailDemo,
  PageOperateModal,
  PageOperateModalDemo,
  PageOperateModal2Demo,
];

const install = function(Vue, opts = {}) {
  //当有全局组件需要注册到Vue.prototype或者window时,或者需要执行的语句,可以在component.index.tpl添加,例如
  //Vue.prototype.$alert = MessageBox.alert;
  Vue.use(Iview);
  Vue.use(BlockComponents)
  components.map(component => {
    Vue.component(component.name, component);
  });

};

/* html通过script标签引入时自动注册全局vue*/
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
};

export default {
  version: '0.2.2',
  install,
  PageDataShow,
  PageDataShowDemo,
  PageOperateDetail,
  PageOperateDetailDemo,
  PageOperateModal,
  PageOperateModalDemo,
  PageOperateModal2Demo
};

