K
K
Kirill Ushakov2018-03-25 19:56:30
Vue.js
Kirill Ushakov, 2018-03-25 19:56:30

vuejs. How to set events on loaded content via ajax?

There is a piece of code loaded with ajax.
For example: <tag @click="someFunc();" />
But in this approach, vue does not see the v-on handler.

How to change it?

PS. The project is not mine, I make minor changes to it. I can't get rid of existing functionality and rewrite everything from scratch. We have to work with what we have.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2018-03-25
@Bellicus

After mounting the resulting markup, run through it and hang handlers manually.
like so
Perversion of course, but it works :)
For good, you need to use https://ru.vuejs.org/v2/guide/components.html#%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question