Commit 7a6181e8c72cd110cdfc09f624f8be43e76ef74c
1 parent
a1b9902b
fix: hmr multiple registered components
Showing
3 changed files
with
10 additions
and
1 deletions
CHANGELOG.zh_CN.md
src/App.vue
src/components/registerGlobComp.ts
... | ... | @@ -5,8 +5,13 @@ import { Button as AntButton } from 'ant-design-vue'; |
5 | 5 | import { getApp } from '/@/useApp'; |
6 | 6 | |
7 | 7 | const compList = [Icon, BasicHelp, BasicTitle, Button, AntButton.Group]; |
8 | + | |
9 | +// Fix hmr multiple registered components | |
10 | +let registered = false; | |
8 | 11 | export function registerGlobComp() { |
12 | + if (registered) return; | |
9 | 13 | compList.forEach((comp: any) => { |
10 | 14 | getApp().component(comp.name, comp); |
11 | 15 | }); |
16 | + registered = true; | |
12 | 17 | } | ... | ... |