A
A
Anton P.2019-04-25 16:41:52
Vue.js
Anton P., 2019-04-25 16:41:52

Execution of JS received from the server in the VUE component. Is it possible?

The site is written in vue.
There is already written logic. One of the pages (component) sends a request to the server and gets the html and just shows it. Of course, I anticipate comments that this is bullshit, and why use vue for this at all, but still, it's already done and that's how it works.

There was a task that in these html there would be not just text, but some kind of logic, for example, a slider, gallery, calculator, etc. Moreover, all this can be at least at the beginning, in the middle, at least at the end, or not at all.

Is it possible in this implementation, in place with HTML, to pass some component - the name, so that vue would pick it up and embed it in the house? Thus, if the manager needs to insert a gallery somewhere in the text, he will simply write

<customGallry :images="['/img1', '/img2', '/img3']"></customGallry>

Something like shortcodes turns out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-04-25
@0xD34F Vue.js

Can. Only this is not called "executing js", but compiling the template. See Vue.compile .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question