There is no need to make the project into a single-page application for the time being, so can vue be simply used in traditional multi-page projects? Has anyone done this before? what should I be aware of?
I always thought that if I used vue as jquery, I would be called a fool. Now that I have an authoritative answer, I can use it without restraint. Thank you!
The answers below are all pretty good, but 南小鸟’s answer is like, you have a question about stocks, and Buffett comes to answer it for you. You have no resistance. It can be adopted. . .
phpcn_u15822017-05-16 13:22:31
Of course. Before vue was so popular, vue was used as jquery in the Laravel circle 23333
phpcn_u15822017-05-16 13:22:31
It can be used, Vue also has server-side rendering, although it’s still a bit confusing now
世界只因有你2017-05-16 13:22:31
It’s ok
module.exports = {
entry: entries, // 这里配置多入口
一个js文件,对应一个views(html)文件,对应一个pages(.vue),vue里可以引入多个vue组件。
PHP中文网2017-05-16 13:22:31
Can be used as a progressive framework, you can completely use Vue as a replacement for jQuery. In the Vue officially integrated by Laravel, Vue is actually combined with the back-end template engine rather than completely separated from the front-end and back-end.
At this time, what you actually need to provide are custom components, not complete pages, otherwise you will encounter an embarrassing problem: why do each of my pages render the same.
PHPz2017-05-16 13:22:31
I just mixed vue and ci to do two or three projects. I think, at least for now, it is not possible to replace jquery with vue. jquery's wheels are much richer than vue. I even mixed vue and jquery and there was still no problem. But I will use vue wherever vue can be used. After all, there is no need to manually update the dom
phpcn_u15822017-05-16 13:22:31
The original problem has been solved, but I still have to say that if you use Vue for multi-page applications, you must use server-side rendering, otherwise there will be unresolved mustache expressions like {{..}} on the page first. , and then the result appears again.