ny
23 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type { Component } from 'vue';
 
import type { ComponentType } from '../types/index';
 
import { tryOnUnmounted } from '@vueuse/core';
 
import { add, del } from '../componentMap';
 
export function useComponentRegister(compName: ComponentType, comp: Component) {
  add(compName, comp);
  tryOnUnmounted(() => {
    del(compName);
  });
}