import FlModel from '../packages/components/com-graphics/index.vue';
import Fl2dcanvas from '../packages/components/com-flcanvas/index.vue';
import FLPerControl from '../packages/components/com-graphics/per-control.vue';
import FlSvg from '../packages/components/com-graphics/pid.vue';
// import FlTiles from '../packages/components/com-tiles/index.vue';
import * as THREE from 'three';
import pkg from '../package.json';

const components = [
  FlModel,
  Fl2dcanvas,
  FLPerControl,
  FlSvg,
  // FlTiles // 倾斜摄影数据组件
];

const install = Vue => {
  Vue.prototype.THREE = THREE;
  components.forEach(component => {
    Vue.component(component.name, component);
  });
};

// 支持浏览器环境直接引入
if (typeof window !== 'undefined') {
  window.FLVersion = pkg.version;
}

export default {
  install,
  FlModel,
  FlSvg,
  Fl2dcanvas,
  // FlTiles,
  FLPerControl,
};
