MCPcopy Index your code
hub / github.com/Tencent/kbone / removeChild

Method removeChild

packages/miniprogram-render/src/node/element.js:823–842  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

821 }
822
823 removeChild(node) {
824 if (!(node instanceof Node)) return
825
826 const index = this.$_children.indexOf(node)
827
828 if (index >= 0) {
829 // 已经插入,需要删除
830 this.$_children.splice(index, 1)
831
832 node.$$updateParent(null)
833
834 // 更新映射表
835 this.$_updateChildrenExtra(node, true)
836
837 // 触发 webview 端更新
838 this.$_triggerMeUpdate()
839 }
840
841 return node
842 }
843
844 insertBefore(node, ref) {
845 if (!(node instanceof Node)) return

Callers 15

node.test.jsFile · 0.80
text-node.test.jsFile · 0.80
element.test.jsFile · 0.80
removeMethod · 0.80
appendChildMethod · 0.80
insertBeforeMethod · 0.80
replaceChildMethod · 0.80
onTransitionEndMethod · 0.80
doDeleteImgMethod · 0.80
deleteItemMethod · 0.80
input.test.jsFile · 0.80
canvas.test.jsFile · 0.80

Calls 3

$_updateChildrenExtraMethod · 0.95
$_triggerMeUpdateMethod · 0.95
$$updateParentMethod · 0.80

Tested by

no test coverage detected