0👍
I ran into the same issue and here are the solutions I found:
- On Vue 2, there is this article that might help some people: https://www.programmersought.com/article/53615036178/
- On Vue 3, there is this library over there, that I used with success.
However, as mentioned by others elsewhere there are a good reasons why this is made so hard to do. Maybe the security reasons are not a big concern for you. But say that your app grows and is so widely used that performance becomes your main concern; then you may want to rebuild your front-end using Svelte instead of Vue. Then, all your @click=this...
(vue specific code) in the html sent by you API will become almost unusable by the Svelte app, at which point you might tell to yourself:
"It would have been way simpler to just send those as json metadata and build the appropriate interface instead of trying to ‘win time’ by brute-forcingly favoring a bad data structure."
Source:stackexchange.com