re: Vue on Django, Part 4 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: There is doubtless much that can be improved, but you've moved me on from "I must learn some front-end framework! I've been meaning to start for a ...

Oh man that’s so nice, thanks! I’m glad I could help out. Good luck!

Thank you very much for the tutorial!
Do you have any idea on how I could implement Vue 2 in my already existing Django blog?
It is not very clear to me how to handle content rendering. Am I using Django templates? Do I include my Vue components in my templates?
It's all blurry :-))

No problem. There are a couple ways to go. If you want Vue to handle the whole thing, then you can basically write the whole template in vue and just have Django serve a barebones template that just serves the vue JavaScript. If you just want vue to handle a smaller piece of the page that needs to be more responsive/interactive, then you can do the majority of the template in Django and source the js for the vue template where you need it. Don’t forget that at the end of the day, vue is just JavaScript, so you can treat it like any other vanilla JavaScript you are adding to your site. Does that help at all?

Hmmm, not sure I fully see it now, I need to tinker with it a bit. Thank you for replying!

One thing that helped me was when I realized that I could simply include Vue as a script tag and have some of my templating logic live right on the same HTML file as my page layout. Here's another good resource that has a nice ramp-in. Hopefully that helps. Let me know what other questions you have, and hopefully I can help :)

Okey dokey, will check it out. i am onto something. Will tell you how it goes when I have something ready-ish

Definitely do. I'm excited to see how it turns out!

code of conduct - report abuse