mirror of https://github.com/vuejs/core.git
wip: revert some changes
This commit is contained in:
parent
31d9247eb7
commit
3cb3e1ac39
|
@ -35,7 +35,7 @@ export function renderSlot(
|
|||
let slot = slots[name]
|
||||
|
||||
// vapor slots rendered in vdom
|
||||
if (slot && slots.__interop) {
|
||||
if (slot && slots._vapor) {
|
||||
const ret = (openBlock(), createBlock(VaporSlot, props))
|
||||
ret.vs = { slot, fallback }
|
||||
return ret
|
||||
|
|
|
@ -56,7 +56,6 @@ import {
|
|||
type VaporSlot,
|
||||
dynamicSlotsProxyHandlers,
|
||||
getSlot,
|
||||
staticSlotsProxyHandler,
|
||||
} from './componentSlots'
|
||||
import { hmrReload, hmrRerender } from './hmr'
|
||||
|
||||
|
@ -417,7 +416,7 @@ export class VaporComponentInstance implements GenericComponentInstance {
|
|||
this.slots = rawSlots
|
||||
? rawSlots.$
|
||||
? new Proxy(rawSlots, dynamicSlotsProxyHandlers)
|
||||
: new Proxy(rawSlots, staticSlotsProxyHandler)
|
||||
: rawSlots
|
||||
: EMPTY_OBJ
|
||||
}
|
||||
|
||||
|
|
|
@ -16,24 +16,8 @@ export type DynamicSlot = { name: string; fn: VaporSlot }
|
|||
export type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
||||
export type DynamicSlotSource = StaticSlots | DynamicSlotFn
|
||||
|
||||
export const staticSlotsProxyHandler: ProxyHandler<any> = {
|
||||
get(target, key) {
|
||||
if (key === '__vapor') {
|
||||
return true
|
||||
} else {
|
||||
return target[key]
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export const dynamicSlotsProxyHandlers: ProxyHandler<RawSlots> = {
|
||||
get: (target, key: string) => {
|
||||
if (key === '__vapor') {
|
||||
return true
|
||||
} else {
|
||||
return getSlot(target, key)
|
||||
}
|
||||
},
|
||||
get: getSlot,
|
||||
has: (target, key: string) => !!getSlot(target, key),
|
||||
getOwnPropertyDescriptor(target, key: string) {
|
||||
const slot = getSlot(target, key)
|
||||
|
|
|
@ -133,7 +133,7 @@ const vaporSlotPropsProxyHandler: ProxyHandler<
|
|||
|
||||
const vaporSlotsProxyHandler: ProxyHandler<any> = {
|
||||
get(target, key) {
|
||||
if (key === '__interop') {
|
||||
if (key === '_vapor') {
|
||||
return target
|
||||
} else {
|
||||
return target[key]
|
||||
|
|
Loading…
Reference in New Issue