Description
What problem does this feature solve?
For custom HTML elements Vue overwrites some attributes with default values. One example is the selected
attribute which will always be set to selected=selected
for truthy values. This absolutely makes sense for HTML elements that are defined in the HTML standard, but not for custom elements. Custom elements are not yet a web standard but there are already ways to build and use them. We experienced the issue when experimenting with a custom element for a tab bar which has the selected tab stored in a selected attribute.
Find a code example in:
https://jsfiddle.net/1pc2e9yj/2/
(The code example is currently limited to Chrome and Safari, because of missing polyfills for other browsers)
What does the proposed API look like?
Vue already has a config setting for ignoredElements
. My proposal would be, that attributes are not set to their default values for elements in the ignoredElements
array. If that approach is valid, then the example code in the jsfiddle would stay the same, but the output would change to "selected attribute value: tab1"