1+ import { Metadata } from 'facing-metadata'
12import { Base } from './index'
23import type { BaseTypeIdentify } from './index'
34import type { InjectConfig } from "./option/inject" ;
@@ -29,7 +30,6 @@ export type SlotMapTypes = {
2930 setup : Map < string , SetupConfig >
3031 customDecorator : Map < string , CustomDecoratorRecord [ ] >
3132}
32-
3333class Slot {
3434 master : any
3535 constructor ( master : any ) {
@@ -52,6 +52,8 @@ class Slot {
5252 cachedVueComponent : any = null
5353}
5454
55+ const metadata = new Metadata < Slot > ( SlotSymbol )
56+
5557export function makeSlot ( obj : any , defaultSlot ?: Slot ) : Slot {
5658 if ( getSlot ( obj ) ) {
5759 throw ''
@@ -69,8 +71,7 @@ export function makeSlot(obj: any, defaultSlot?: Slot): Slot {
6971}
7072
7173export function getSlot ( obj : any ) : Slot | undefined {
72-
73- return Object . getOwnPropertyDescriptor ( obj , SlotSymbol ) ?. value
74+ return metadata . getOwn ( obj )
7475}
7576
7677export function obtainSlot ( obj : any , defaultSlot ?: Slot ) : Slot {
@@ -127,7 +128,7 @@ export function excludeNames(names: string[], slot: Slot, filter?: (mapName: str
127128 if ( mapName === 'customDecorator' ) {
128129 const map = currSlot . obtainMap ( 'customDecorator' )
129130 if ( map . has ( name ) ) {
130- if ( map . get ( name ) ! . every ( ite => ! ite . preserve ) ) {
131+ if ( map . get ( name ) ! . every ( ite => ! ite . preserve ) ) {
131132 return false
132133 } else {
133134 continue
0 commit comments