javascript - Everyone is using Vue for single-page projects, so can Vue be used for traditional multi-page projects?
仅有的幸福
仅有的幸福 2017-05-16 13:20:31
0
9
908

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. . .

仅有的幸福
仅有的幸福

reply all(9)
Ty80

I think you should adopt it

phpcn_u1582

Of course. Before vue was so popular, vue was used as jquery in the Laravel circle 23333

伊谢尔伦

It works without any problems.

phpcn_u1582

It can be used, Vue also has server-side rendering, although it’s still a bit confusing now

世界只因有你

It’s ok

module.exports = {
  entry: entries, // 这里配置多入口

一个js文件,对应一个views(html)文件,对应一个pages(.vue),vue里可以引入多个vue组件。
習慣沉默

Yes, just import the <script> tag directly.
Use it like jq

洪涛

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.

PHPzhong

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_u1582

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!