MCPcopy Create free account
hub / github.com/TruthHun/BookStack / processAttrs

Function processAttrs

static/vuejs/vue.js:8083–8148  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

8081}
8082
8083function processAttrs (el) {
8084 var list = el.attrsList;
8085 var i, l, name, rawName, value, modifiers, isProp;
8086 for (i = 0, l = list.length; i < l; i++) {
8087 name = rawName = list[i].name;
8088 value = list[i].value;
8089 if (dirRE.test(name)) {
8090 // mark element as dynamic
8091 el.hasBindings = true;
8092 // modifiers
8093 modifiers = parseModifiers(name);
8094 if (modifiers) {
8095 name = name.replace(modifierRE, '');
8096 }
8097 if (bindRE.test(name)) { // v-bind
8098 name = name.replace(bindRE, '');
8099 value = parseFilters(value);
8100 isProp = false;
8101 if (modifiers) {
8102 if (modifiers.prop) {
8103 isProp = true;
8104 name = camelize(name);
8105 if (name === 'innerHtml') { name = 'innerHTML'; }
8106 }
8107 if (modifiers.camel) {
8108 name = camelize(name);
8109 }
8110 }
8111 if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
8112 addProp(el, name, value);
8113 } else {
8114 addAttr(el, name, value);
8115 }
8116 } else if (onRE.test(name)) { // v-on
8117 name = name.replace(onRE, '');
8118 addHandler(el, name, value, modifiers);
8119 } else { // normal directives
8120 name = name.replace(dirRE, '');
8121 // parse arg
8122 var argMatch = name.match(argRE);
8123 var arg = argMatch && argMatch[1];
8124 if (arg) {
8125 name = name.slice(0, -(arg.length + 1));
8126 }
8127 addDirective(el, name, rawName, value, arg, modifiers);
8128 if ("development" !== 'production' && name === 'model') {
8129 checkForAliasModel(el, value);
8130 }
8131 }
8132 } else {
8133 // literal attribute
8134 {
8135 var expression = parseText(value, delimiters);
8136 if (expression) {
8137 warn$2(
8138 name + "=\"" + value + "\": " +
8139 'Interpolation inside attributes has been removed. ' +
8140 'Use v-bind or the colon shorthand instead. For example, ' +

Callers 1

parseFunction · 0.70

Calls 8

parseModifiersFunction · 0.70
parseFiltersFunction · 0.70
addPropFunction · 0.70
addAttrFunction · 0.70
addHandlerFunction · 0.70
addDirectiveFunction · 0.70
checkForAliasModelFunction · 0.70
parseTextFunction · 0.70

Tested by

no test coverage detected