P
P
Pavel Kornilov2019-02-28 12:44:38
Vue.js
Pavel Kornilov, 2019-02-28 12:44:38

How to execute an external script when updating a model?

Hello!
I just can’t cope with the task of executing scripts that came in the server’s response in data.
For example, the $.load() method in jQuery successfully performs a similar task.
Here is my simplest example: https://codepen.io/KorniloFF/pen/NJGpxj?editors=1011

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Kovalchuk, 2019-02-28
@KorniloFF

I quickly threw in the code, you can make it more beautiful, but I think I gave the idea
https://codepen.io/anon/pen/QojvoL?editors=1011

P
Pavel Kornilov, 2019-03-01
@KorniloFF

Alexander Kovalchuk , I post my crutch on the subject: https://codepen.io/KorniloFF/pen/ZPbyBe
The question continues to be of interest: is it possible to somehow dynamically load your documentFragment into the virtual DOM Vue? Possibly using a render function.
Maybe someone will come in handy, because in general it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question