Skip to content

Commit 9d26a16

Browse files
author
Stanislav Lashmanov
committed
fix(compat): include legacy scoped slots
close vuejs#8869
1 parent c9c9dff commit 9d26a16

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

packages/runtime-core/src/compat/instance.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
} from './renderHelpers'
3838
import { resolveFilter } from '../helpers/resolveAssets'
3939
import type { InternalSlots, Slots } from '../componentSlots'
40-
import type { ContextualRenderFn } from '../componentRenderContext'
4140
import { resolveMergedOptions } from '../componentOptions'
4241

4342
export type LegacyPublicInstance = ComponentPublicInstance &
@@ -109,9 +108,7 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
109108
const res: InternalSlots = {}
110109
for (const key in i.slots) {
111110
const fn = i.slots[key]!
112-
if (!(fn as ContextualRenderFn)._ns /* non-scoped slot */) {
113-
res[key] = fn
114-
}
111+
res[key] = fn
115112
}
116113
return res
117114
},

packages/vue-compat/__tests__/instance.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
284284
).toHaveBeenWarned()
285285
})
286286

287-
test('should not include legacy slot usage in $scopedSlots', () => {
287+
test('should include legacy slot usage in $scopedSlots', () => {
288288
let normalSlots: Slots
289289
let scopedSlots: Slots
290290
new Vue({
@@ -301,7 +301,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
301301
}).$mount()
302302

303303
expect('default' in normalSlots!).toBe(true)
304-
expect('default' in scopedSlots!).toBe(false)
304+
expect('default' in scopedSlots!).toBe(true)
305305

306306
expect(
307307
deprecationData[DeprecationTypes.INSTANCE_SCOPED_SLOTS].message,

0 commit comments

Comments
 (0)