mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 15:41:32 +08:00
fix: hmr multiple registered components
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
moment.locale('zh-cn');
|
||||
|
||||
export default defineComponent({
|
||||
name: 'App',
|
||||
name: 'App1',
|
||||
components: { ConfigProvider },
|
||||
setup() {
|
||||
useInitAppConfigStore();
|
||||
|
@@ -5,8 +5,13 @@ import { Button as AntButton } from 'ant-design-vue';
|
||||
import { getApp } from '/@/useApp';
|
||||
|
||||
const compList = [Icon, BasicHelp, BasicTitle, Button, AntButton.Group];
|
||||
|
||||
// Fix hmr multiple registered components
|
||||
let registered = false;
|
||||
export function registerGlobComp() {
|
||||
if (registered) return;
|
||||
compList.forEach((comp: any) => {
|
||||
getApp().component(comp.name, comp);
|
||||
});
|
||||
registered = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user