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

Function processAttrs

static/vuejs/vue.esm.js:8087–8152  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

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