The following method is a bit more declarative, using a named parameter in your main Vue component. Assuming you've injected context variable "token" into your django view context, you could do something like this in your django template:
<script>const jscontext={token: '{{ token }}'}</script>
<!--Could just have easily been simple variable. An object with
multiple properties could be used for a more comprehensive context-->
<div id="app"></div>
{% render_bundle 'app' %}
In App.vue you would add code to accept a property called token:
<script>
export default {
name: "app",
props: {
token: {
type: String,
required: true
}
}
}
</script>
And then in your main.js (or whatever creates your Vue component, probably build.js in your example) you would invoke the component with the token property from the jscontext object you created in the earlier template script
new Vue({
router,
render: h => h(App, {props: {token:jscontext.token}})
}).$mount('#app')
token will now be made available to App.vue via its property, so can be rendered with {{ token }} or accessed in code with this.token, etc. As per previous comments, the token would be visible in the source.