0๐
You are returning an object from your method which is not applying the style to the element. You could set a boolean in your state which determines the styles applied to the element and handle the rest in your template. Or you could let your boolean determine to merge the style in your computed styles.
- [Vuejs]-Run some external JS code at runtime in Vue
- [Vuejs]-Search Input Is Cancelling Text as one types in vuejs
0๐
This is the best solution you are looking for https://stackoverflow.com/a/46553407/14438744 (use background-image
instead)
If you really want to use mouseover, then stylesOnHover need to be a method or if computed then it needs to return a function. You will then change the backgroundImage of event.target.style
inside that method/function.
Source:stackexchange.com