C
C
coderisimo2018-02-13 20:42:59
Yii
coderisimo, 2018-02-13 20:42:59

Vue.js and ready-made markup from the server. Is it possible to share?

I work on a project with more experienced colleagues. They are often strongly opposed to rendering markup on the client. For example, there used to be DataTables and json with data, and now there will be tables from Kartik yii2-grid. Colleagues argue that in this case the idea is more suitable to generate everything on the server. They use Pjax, etc.
In this regard, is it possible to use, for example, a ready-made list in the markup in conjunction with VUE?
After all, the standard practice is to use constructions of the form: what if the list is already on the page? Is it possible to somehow add its data to the model and use all the goodies of the page elements associated with the model? Or is this already an attempt to "cross a hedgehog and a snake"? )) thanks
<li v-for="item in items">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Shcherbin, 2018-02-22
@ischerbin

It is possible, but, as you yourself said, this is a crossing of a hedgehog and a snake. The point of using Vue is lost in principle. For example, if the markup of the list is changed, the procedure for parsing it may not work. You will also have to independently monitor the list update via Ajax.
In this case, you still need to find out from your colleagues why they are against it, maybe the page should be indexed by search engines, and the content generated on the client still has trouble with this, despite the efforts of the search engines. Well, in general, when working together on a project, you must follow the approaches adopted by the team.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question