Skip to content

Commit

Permalink
refactor: isCE -> ce
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 5, 2024
1 parent 6e541db commit b74687c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export interface ComponentInternalInstance {
* is custom element?
* @internal
*/
isCE?: Element
ce?: Element
/**
* custom element specific HMR method
* @internal
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime-core/src/helpers/renderSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export function renderSlot(
noSlotted?: boolean,
): VNode {
if (
currentRenderingInstance!.isCE ||
currentRenderingInstance!.ce ||
(currentRenderingInstance!.parent &&
isAsyncWrapper(currentRenderingInstance!.parent) &&
currentRenderingInstance!.parent.isCE)
currentRenderingInstance!.parent.ce)
) {
// in custom element mode, render <slot/> as actual slot outlets
// wrap it with a fragment because in shadowRoot: false mode the slot
Expand Down
6 changes: 3 additions & 3 deletions packages/runtime-dom/src/apiCustomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class VueElement extends BaseClass {
this._ob = null
}
render(null, this._root)
this._instance!.isCE = undefined
this._instance!.ce = undefined
this._instance = null
}
})
Expand Down Expand Up @@ -433,7 +433,7 @@ export class VueElement extends BaseClass {
if (!this._instance) {
vnode.ce = instance => {
this._instance = instance
instance.isCE = this
instance.ce = this
// HMR
if (__DEV__) {
instance.ceReload = newStyles => {
Expand Down Expand Up @@ -555,7 +555,7 @@ export class VueElement extends BaseClass {
*/
export function useShadowRoot(): ShadowRoot | null {
const instance = getCurrentInstance()
const el = instance && instance.isCE
const el = instance && instance.ce
if (el) {
return el.shadowRoot
} else if (__DEV__) {
Expand Down

0 comments on commit b74687c

Please sign in to comment.