Skip to content

Commit 20f9766

Browse files
committed
fix extend exclude names
1 parent b2dc14f commit 20f9766

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import { build as optionAccessor } from './option/accessor'
1313
import type { OptionBuilder } from './optionBuilder'
1414
import type { VueCons } from './index'
1515
export type Cons = VueCons
16+
1617
// export interface Cons { new(): any, prototype: any }
1718
function ComponentOption(cons: Cons, extend?: any) {
19+
1820
const optionBuilder: OptionBuilder = {}
1921
optionVModel(cons, optionBuilder)
2022
optionComputed(cons, optionBuilder)//after VModel

src/utils.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,21 @@ export function getSuperSlot(obj: any) {
125125

126126
export function excludeNames(names: string[], slot: Slot) {
127127
return names.filter(name => {
128-
for (const mapName of slot.names.keys()) {
129-
if (['watch', 'hooks'].includes(mapName)) {
130-
continue
131-
}
132-
const map = slot.names.get(mapName)!
133-
if (map.has(name)) {
134-
return false
128+
let currSlot: Slot | null = slot
129+
130+
while (currSlot != null) {
131+
for (const mapName of currSlot.names.keys()) {
132+
if (['watch', 'hooks'].includes(mapName)) {
133+
continue
134+
}
135+
const map = currSlot.names.get(mapName)!
136+
if (map.has(name)) {
137+
return false
138+
}
135139
}
140+
currSlot = getSuperSlot(slot.master)
136141
}
142+
137143
return true
138144
})
139145
}

0 commit comments

Comments
 (0)