Currently, I am in the process of integrating Vue and Django with django-webpack-loader (not DRF). However, I have encountered a roadblock when attempting to pass data from Django to Vue. My goal is to transform a static Django template into a (.vue) Vue template, but I am unsure how Vue should handle this data.
My understanding is that I should do something like the following within the script tags:
new Vue ({
data: function () {
game: {{game}}
}
});
Subsequently, I would reference this using {{game.title}}
in the main HTML of the Vue template, utilizing Django's {% verbatim %}
tags to prevent any interference, right?
Despite my efforts, Django does not provide Vue with any data, resulting in errors such as 'game:' is defined but never used' and 'game' is not defined'. I find myself at an impasse and require assistance moving forward...