2020-09-28 20:19:10 +08:00
|
|
|
import Icon from './Icon/index';
|
|
|
|
|
import Button from './Button/index.vue';
|
2020-10-20 21:06:12 +08:00
|
|
|
import { Button as AntButton } from 'ant-design-vue';
|
|
|
|
|
import { getApp } from '/@/useApp';
|
2020-09-28 20:19:10 +08:00
|
|
|
|
2020-10-29 23:59:54 +08:00
|
|
|
const compList = [Icon, Button, AntButton.Group];
|
2020-10-27 21:53:53 +08:00
|
|
|
|
|
|
|
|
// Fix hmr multiple registered components
|
|
|
|
|
let registered = false;
|
2020-10-20 21:06:12 +08:00
|
|
|
export function registerGlobComp() {
|
2020-10-27 21:53:53 +08:00
|
|
|
if (registered) return;
|
2020-09-28 20:19:10 +08:00
|
|
|
compList.forEach((comp: any) => {
|
2020-10-20 21:06:12 +08:00
|
|
|
getApp().component(comp.name, comp);
|
2020-09-28 20:19:10 +08:00
|
|
|
});
|
2020-10-27 21:53:53 +08:00
|
|
|
registered = true;
|
2020-09-28 20:19:10 +08:00
|
|
|
}
|