1👍
✅
Typically, you wouldn’t manipulate DOM elements but rather your vue component’s state and then bind that state to the DOM.
You’ll want to
- bind the button’s (data-) attributes to your vue component’s state: https://v2.vuejs.org/v2/guide/syntax.html#Attributes
- bind the button click to a method in your component setting that state: https://v2.vuejs.org/v2/guide/instance.html#Data-and-Methods
Here’s a working example: https://codesandbox.io/s/stack-overflow-q-59026962-onb7j.
I left out the spinner toggle & removed some markup for clarity.
Source:stackexchange.com