Skip to content

Commit

Permalink
fix(core/dom): fix push and insert error
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaodong2008 committed Jul 15, 2024
1 parent 91f8930 commit aa4df10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/dom/dom-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export function createMethods<ElementType extends ElementList>(
clone?: boolean
): PushReturn<T, ElementType> {
// @ts-expect-error Check if el is FastjsDom | FastjsDomList
el = el.el ? el : el.el();
el = el.tagName ? el : el.el();

type IsReplace<T> = T extends "replaceElement" ? true : false;
const isReplace = (target === "replaceElement") as IsReplace<T>;
Expand Down Expand Up @@ -505,7 +505,7 @@ export function createMethods<ElementType extends ElementList>(
clone?: boolean
): InsertReturn<ElementType> {
// @ts-expect-error Check if el is FastjsDom | FastjsDomList
el = el.el ? el : el.el();
el = el.tagName ? el : el.el();

const newElement = createFastjsDom(clone ? el.cloneNode(true) : el);
if (typeof target === "number") {
Expand Down

0 comments on commit aa4df10

Please sign in to comment.