Django Vite Vue #7
Replies: 1 comment 1 reply
-
|
Hi, Sorry for the delayed response. I need to set up some notifications. This setup lends itself to declaring separate Vue apps per page. To have multiple pages within the same Vue app, then I think you'd be better off creating an SPA and use Vue router. Using Vue within a Django template best suits the use case where you want to add small amounts of interactivity to a page without the full effort of creating an SPA. I'm not yet familiar with translation. As for passing in It lacks the convenience of the URL tags but will save you from hard-coding them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have been looking for a way to properly bundle and also manage packages in django for months, but this is the best solution so far.
I have some experience using Django, but just started out with Vue.
The tutorial was excellent, but left me with some questions while trying to integrate this in a side project.
The first question I stumbled upon is how can I reuse components like a navbar over multiple pages in this setup?
I am mainly using tailwindcss, so I want to move all my django templates to Vue to minify the css properly.
Searching for tutorials on multipage vue3 led me to nothing helpful.
The next is thing is translation.
Since I can't use
{% trans %}in vue files, do I need to use more libraries to export django translation to js translation?Also, referencing urls got more tedious since I found no way to pass
{% url %}to vue.It would be great if you could help me with some of my questions.
There are really a lot of drawbacks I didn't think of when using django with modern js.
Beta Was this translation helpful? Give feedback.
All reactions