Skip to content

Commit 5340f1b

Browse files
committed
fix: don't set ignoredElements' attributes to their default values (vuejs#6864)
1 parent 048e940 commit 5340f1b

File tree

1 file changed

+8
-0
lines changed
  • src/platforms/web/runtime/modules

1 file changed

+8
-0
lines changed

src/platforms/web/runtime/modules/attrs.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* @flow */
22

33
import { isIE9, isEdge } from 'core/util/env'
4+
import config from 'core/config'
45

56
import {
67
extend,
@@ -59,6 +60,13 @@ function updateAttrs (oldVnode: VNodeWithData, vnode: VNodeWithData) {
5960
}
6061

6162
function setAttr (el: Element, key: string, value: any) {
63+
// The attributes are not set to their default values
64+
// for elements in the ignoredElements array
65+
// eg. <custom-tab-bar selected="tab1"></custom-tab-bar>
66+
if (config.ignoredElements.indexOf(el.tagName.toLowerCase()) > -1) {
67+
el.setAttribute(key, value)
68+
return
69+
}
6270
if (isBooleanAttr(key)) {
6371
// set attribute for blank value
6472
// e.g. <option disabled>Select one</option>

0 commit comments

Comments
 (0)