-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Description
Vue.js v1.0.21
vue-router v0.7.13
<cc-page class=""></cc-page>
Leads to
"Uncaught SyntaxError: Failed to execute 'add' on 'DOMTokenList': The token provided must not be empty." in Chrome Version 49.0.2623.112 m
In the function
/**
* Add class with compatibility for IE & SVG
*
* @param {Element} el
* @param {String} cls
*/
function addClass(el, cls) {
if (el.classList) {
el.classList.add(cls);
} else {
var cur = ' ' + getClass(el) + ' ';
if (cur.indexOf(' ' + cls + ' ') < 0) {
setClass(el, (cur + cls).trim());
}
}
}
Because parameter 'cls' is an empty string in this case and the error happens in my case in
el.classList.add(cls);
Maybe an empty 'cls' should lead to an early out here.
Metadata
Metadata
Assignees
Labels
No labels