R
R
Romi2021-04-14 13:04:57
Laravel
Romi, 2021-04-14 13:04:57

What is the best routing for integrating Vue.js directly into the Blade template (via the script tag)?

Now I am trying to initially understand the most convenient way to create an application on Laravel + Vue.js, in which Vue.js is built directly into Blade templates (it doesn’t work any other way - there is a lot of legacy), but the data is pulled to the page through the API.

Here, for example, banal CRUD - how best to implement:

1. Make a separate Blade template for Read-Update

2. Or on the same page through some v-show or in a modal window, for example?

And if there are a dozen or two such cruds planned?

I just want to do it optimally right away, so as not to redo it later))

But there is no experience of just such an approach.

If someone has already gone through this - tell me how better plz. And why.

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kudrya, 2021-04-14
@romicohen

Make a vue router without history mode, the url will have a postscript /#/ and in fact it will turn out to be a regular spa, or else make a separate route like /my-cool-vue-crud and everything that goes there with a postscript after that will fall on that the same template, and vue itself will understand where what is going on, here you can already work with history mode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question