File tree 2 files changed +4
-12
lines changed
2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ import {
36
36
legacyresolveScopedSlots ,
37
37
} from './renderHelpers'
38
38
import { resolveFilter } from '../helpers/resolveAssets'
39
- import type { InternalSlots , Slots } from '../componentSlots'
40
- import type { ContextualRenderFn } from '../componentRenderContext'
39
+ import type { Slots } from '../componentSlots'
41
40
import { resolveMergedOptions } from '../componentOptions'
42
41
43
42
export type LegacyPublicInstance = ComponentPublicInstance &
@@ -106,14 +105,7 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
106
105
107
106
$scopedSlots : i => {
108
107
assertCompatEnabled ( DeprecationTypes . INSTANCE_SCOPED_SLOTS , i )
109
- const res : InternalSlots = { }
110
- for ( const key in i . slots ) {
111
- const fn = i . slots [ key ] !
112
- if ( ! ( fn as ContextualRenderFn ) . _ns /* non-scoped slot */ ) {
113
- res [ key ] = fn
114
- }
115
- }
116
- return res
108
+ return __DEV__ ? shallowReadonly ( i . slots ) : i . slots
117
109
} ,
118
110
119
111
$on : i => on . bind ( null , i ) ,
Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
284
284
) . toHaveBeenWarned ( )
285
285
} )
286
286
287
- test ( 'should not include legacy slot usage in $scopedSlots' , ( ) => {
287
+ test ( 'should include legacy slot usage in $scopedSlots' , ( ) => {
288
288
let normalSlots : Slots
289
289
let scopedSlots : Slots
290
290
new Vue ( {
@@ -301,7 +301,7 @@ describe('INSTANCE_SCOPED_SLOTS', () => {
301
301
} ) . $mount ( )
302
302
303
303
expect ( 'default' in normalSlots ! ) . toBe ( true )
304
- expect ( 'default' in scopedSlots ! ) . toBe ( false )
304
+ expect ( 'default' in scopedSlots ! ) . toBe ( true )
305
305
306
306
expect (
307
307
deprecationData [ DeprecationTypes . INSTANCE_SCOPED_SLOTS ] . message ,
You can’t perform that action at this time.
0 commit comments