wip: $scopedSlots compat
This commit is contained in:
parent
960e9deaed
commit
c9a93a5c4c
@ -24,6 +24,7 @@ export const enum DeprecationTypes {
|
|||||||
INSTANCE_EVENT_HOOKS = 'INSTANCE_EVENT_HOOKS',
|
INSTANCE_EVENT_HOOKS = 'INSTANCE_EVENT_HOOKS',
|
||||||
INSTANCE_CHILDREN = 'INSTANCE_CHILDREN',
|
INSTANCE_CHILDREN = 'INSTANCE_CHILDREN',
|
||||||
INSTANCE_LISTENERS = 'INSTANCE_LISTENERS',
|
INSTANCE_LISTENERS = 'INSTANCE_LISTENERS',
|
||||||
|
INSTANCE_SCOPED_SLOTS = 'INSTANCE_SCOPED_SLOTS',
|
||||||
|
|
||||||
OPTIONS_DATA_FN = 'OPTIONS_DATA_FN',
|
OPTIONS_DATA_FN = 'OPTIONS_DATA_FN',
|
||||||
OPTIONS_DATA_MERGE = 'OPTIONS_DATA_MERGE',
|
OPTIONS_DATA_MERGE = 'OPTIONS_DATA_MERGE',
|
||||||
@ -182,6 +183,11 @@ const deprecationData: Record<DeprecationTypes, DeprecationData> = {
|
|||||||
link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
|
link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
|
||||||
},
|
},
|
||||||
|
|
||||||
|
[DeprecationTypes.INSTANCE_SCOPED_SLOTS]: {
|
||||||
|
message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
|
||||||
|
link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
|
||||||
|
},
|
||||||
|
|
||||||
[DeprecationTypes.OPTIONS_DATA_FN]: {
|
[DeprecationTypes.OPTIONS_DATA_FN]: {
|
||||||
message:
|
message:
|
||||||
`The "data" option can no longer be a plain object. ` +
|
`The "data" option can no longer be a plain object. ` +
|
||||||
|
@ -20,23 +20,33 @@ export function installCompatInstanceProperties(map: PublicPropertiesMap) {
|
|||||||
assertCompatEnabled(DeprecationTypes.INSTANCE_SET)
|
assertCompatEnabled(DeprecationTypes.INSTANCE_SET)
|
||||||
return set
|
return set
|
||||||
},
|
},
|
||||||
|
|
||||||
$delete: () => {
|
$delete: () => {
|
||||||
assertCompatEnabled(DeprecationTypes.INSTANCE_DELETE)
|
assertCompatEnabled(DeprecationTypes.INSTANCE_DELETE)
|
||||||
return del
|
return del
|
||||||
},
|
},
|
||||||
|
|
||||||
$mount: i => {
|
$mount: i => {
|
||||||
assertCompatEnabled(DeprecationTypes.GLOBAL_MOUNT)
|
assertCompatEnabled(DeprecationTypes.GLOBAL_MOUNT)
|
||||||
// root mount override from ./global.ts in installCompatMount
|
// root mount override from ./global.ts in installCompatMount
|
||||||
return i.ctx._compat_mount || NOOP
|
return i.ctx._compat_mount || NOOP
|
||||||
},
|
},
|
||||||
|
|
||||||
$destroy: i => {
|
$destroy: i => {
|
||||||
assertCompatEnabled(DeprecationTypes.INSTANCE_DESTROY)
|
assertCompatEnabled(DeprecationTypes.INSTANCE_DESTROY)
|
||||||
// root destroy override from ./global.ts in installCompatMount
|
// root destroy override from ./global.ts in installCompatMount
|
||||||
return i.ctx._compat_destroy || NOOP
|
return i.ctx._compat_destroy || NOOP
|
||||||
},
|
},
|
||||||
|
|
||||||
|
$scopedSlots: i => {
|
||||||
|
assertCompatEnabled(DeprecationTypes.INSTANCE_SCOPED_SLOTS)
|
||||||
|
return i.slots
|
||||||
|
},
|
||||||
|
|
||||||
$on: i => on.bind(null, i),
|
$on: i => on.bind(null, i),
|
||||||
$once: i => once.bind(null, i),
|
$once: i => once.bind(null, i),
|
||||||
$off: i => off.bind(null, i),
|
$off: i => off.bind(null, i),
|
||||||
|
|
||||||
$children: getCompatChildren,
|
$children: getCompatChildren,
|
||||||
$listeners: getCompatListeners
|
$listeners: getCompatListeners
|
||||||
} as PublicPropertiesMap)
|
} as PublicPropertiesMap)
|
||||||
|
Loading…
Reference in New Issue
Block a user