MCPcopy
hub / github.com/ygs-code/vue / getAndRemoveAttr

Function getAndRemoveAttr

vue.js:9845–9863  ·  view source on GitHub ↗
(el, //el  虚拟dom
        name,//属性名称 需要删除的属性 name,获取值的name属性
        removeFromMap //是否要删除属性的标志
    )

Source from the content-addressed store, hash-verified

9843
9844 //移除传进来的属性name,并且返回获取到 属性的值
9845 function getAndRemoveAttr(el, //el 虚拟dom
9846 name,//属性名称 需要删除的属性 name,获取值的name属性
9847 removeFromMap //是否要删除属性的标志
9848 ) {
9849 var val;
9850 if ((val = el.attrsMap[name]) != null) {
9851 var list = el.attrsList; //按地址引用
9852 for (var i = 0, l = list.length; i < l; i++) {
9853 if (list[i].name === name) {
9854 list.splice(i, 1); //按地址引用 删除一个属性name
9855 break
9856 }
9857 }
9858 }
9859 if (removeFromMap) { //是否要删除属性的标志
9860 delete el.attrsMap[name];
9861 }
9862 return val
9863 }
9864
9865 /* */
9866

Callers 10

getBindingAttrFunction · 0.85
transformNodeFunction · 0.85
transformNode$1Function · 0.85
processPreFunction · 0.85
processForFunction · 0.85
processIfFunction · 0.85
processOnceFunction · 0.85
processSlotFunction · 0.85
processComponentFunction · 0.85
preTransformNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected