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

Function processAttrs

static/vuejs/vue.common.js:8089–8154  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

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