mirror of https://github.com/vuejs/core.git
refactor: remove InsertPosition
This commit is contained in:
parent
5df8f0e134
commit
b3fdccec6f
|
@ -30,22 +30,11 @@ export function normalizeContainer(container: string | ParentNode): ParentNode {
|
||||||
: container
|
: container
|
||||||
}
|
}
|
||||||
|
|
||||||
export const enum InsertPosition {
|
|
||||||
FIRST,
|
|
||||||
LAST
|
|
||||||
}
|
|
||||||
|
|
||||||
export function insert(
|
export function insert(
|
||||||
block: Block,
|
block: Block,
|
||||||
parent: ParentNode,
|
parent: ParentNode,
|
||||||
anchor: Node | InsertPosition | null = null
|
anchor: Node | null = null
|
||||||
) {
|
) {
|
||||||
anchor =
|
|
||||||
typeof anchor === 'number'
|
|
||||||
? anchor === InsertPosition.FIRST
|
|
||||||
? parent.firstChild
|
|
||||||
: null
|
|
||||||
: anchor
|
|
||||||
// if (!isHydrating) {
|
// if (!isHydrating) {
|
||||||
if (block instanceof Node) {
|
if (block instanceof Node) {
|
||||||
parent.insertBefore(block, anchor)
|
parent.insertBefore(block, anchor)
|
||||||
|
|
Loading…
Reference in New Issue