0👍
✅
- Don’t name the
created
function the same as the vuejslifecycle function
. -
No need to declare it outside of your export, place it in
methods
, like this:methods: {
init: function() {
//code goes here
}
} document.getElementsByClassName
does not return an instance of a node and therefore you can’t set the style this way. You would have to loop all elements first.- You could just define the
style
as an object in yourdata
function and bind it to the element with:style="someStyleObject"
- You can’t define
mode
indata
if it’s also a property. - Check your console, you’re going to have errors.
Source:stackexchange.com