0👍
Do not use the php
variable, set a vue variable for that php
variable instead. Something like:
// Vue instance ...
data: {
test: '{{ test }}',
}
and then use it in html like:
<p> @{{ test }} </p>
Update:
You might want to bind your upper div
or nav
to the Vue instance.
Add an ID to it: <nav id="my_nav">
then on a Vue instance you can:
var a_vue_instance = new Vue({
el: '#my_nav',
data: {
title: 'test',
},
}
- [Vuejs]-Separating var app = new Vue({}); to another app.js
- [Vuejs]-Proper way to dynamically set many inputs values, getting data from Vuex store
Source:stackexchange.com