[Vuejs]-Change variables dynamically in laravel

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',
    },
}

Leave a comment