Browse Source

disable duplicate attribute warning in IE (close #3929)

dev
Evan You 8 years ago
parent
commit
30bd34e965
  1. 6
      src/compiler/parser/index.js

6
src/compiler/parser/index.js

@ -79,7 +79,7 @@ export function parse (
type: 1, type: 1,
tag, tag,
attrsList: attrs, attrsList: attrs,
attrsMap: makeAttrsMap(attrs), attrsMap: makeAttrsMap(attrs, options.isIE),
parent: currentParent, parent: currentParent,
children: [] children: []
} }
@ -429,10 +429,10 @@ function parseModifiers (name: string): Object | void {
} }
} }
function makeAttrsMap (attrs: Array<Object>): Object { function makeAttrsMap (attrs: Array<Object>, isIE: ?boolean): Object {
const map = {} const map = {}
for (let i = 0, l = attrs.length; i < l; i++) { for (let i = 0, l = attrs.length; i < l; i++) {
if (process.env.NODE_ENV !== 'production' && map[attrs[i].name]) { if (process.env.NODE_ENV !== 'production' && map[attrs[i].name] && !isIE) {
warn('duplicate attribute: ' + attrs[i].name) warn('duplicate attribute: ' + attrs[i].name)
} }
map[attrs[i].name] = attrs[i].value map[attrs[i].name] = attrs[i].value

Loading…
Cancel
Save