V
V
Victor2020-03-28 20:51:11
JavaScript
Victor, 2020-03-28 20:51:11

What to do with components that are loaded via AJAX?

Let's say there is a project where there is an "Application" object, there is a detailed page with this application and a table of these applications.
In the table, when you click on the link, the detailed page of the application opens via AJAX in fancyBox within the same page with the application table.

There are comments on the ticket detail page that have been converted to Vue.js, simplified as:

<comments>
    <comment v-for="comment in comments" :comment="comment"></comment>
</comments>


And everything works fine.
But now, when fancybox is loaded, comments are not loaded (which is expected) because Vue does not render components loaded via AJAX.

So the question is, how is this usually done in the Vue world?
Or do they make a separate component (hidden at first), into which, when clicked, all the application data is loaded and it is displayed in a modal window? But in this case, it will be necessary, apparently, to redo the entire application page for a Vue component.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-03-28
@bacon

Well, yes, the component should already be in advance, load only data via AJAX.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question