Answer the question
In order to leave comments, you need to log in
How does flask and vue-router interact?
Hello. I'm trying to build a regular todo as a full spa on flask and vuejs. I ran into a routing problem. How to send paths in vue-router via flask?
Answer the question
In order to leave comments, you need to log in
Regardless of whether you use flask or any other framework or write without it, a spa application is usually divided into 2 independent parts: frontend and backend. The first is the html css and js (vue, vue-router) and the second is the server logic itself. Data should be received using asynchronous (ajax) requests to the backend. That is, the backend, in this case, acts as an independent api.
For example, you want to write hello world by getting data from the server.
I don't really understand what problem you are facing. But you probably still need to use vue-router's routes rather than flask's routes to navigate the SPA. And leave flask's routes alone as api endpoints.
Perhaps this page will be useful - https://router.vuejs.org/en/essentials/history-mod...
I also asked this question :) As a result, I figured it out and wrote an article:
https://codeburst.io/full-stack-single-page-applic...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question