mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-05 05:27:59 +08:00
minor tweaks
This commit is contained in:
parent
d2f7f1913e
commit
28ec3c7709
@ -132,10 +132,10 @@ if (typeof Set !== 'undefined' && isNative(Set)) {
|
||||
this.set = Object.create(null)
|
||||
}
|
||||
has (key: string | number) {
|
||||
return this.set[key] !== undefined
|
||||
return this.set[key] === true
|
||||
}
|
||||
add (key: string | number) {
|
||||
this.set[key] = 1
|
||||
this.set[key] = true
|
||||
}
|
||||
clear () {
|
||||
this.set = Object.create(null)
|
||||
|
@ -202,7 +202,11 @@ export function createPatchFunction (backend) {
|
||||
|
||||
function insert (parent, elm, ref) {
|
||||
if (parent) {
|
||||
nodeOps.insertBefore(parent, elm, ref)
|
||||
if (ref) {
|
||||
nodeOps.insertBefore(parent, elm, ref)
|
||||
} else {
|
||||
nodeOps.appendChild(parent, elm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,6 @@ export function createComment (text) {
|
||||
}
|
||||
|
||||
export function insertBefore (node, target, before) {
|
||||
if (!before) {
|
||||
return appendChild(node, target)
|
||||
}
|
||||
if (target.nodeType === 3) {
|
||||
if (node.type === 'text') {
|
||||
node.setAttr('value', target.text)
|
||||
|
Loading…
Reference in New Issue
Block a user