[Vuejs]-Vue Js not updating from JSON

0👍

You didn’t call the method. You should use a button to trigger the method.

html

<div id="menuPage">{{HeaderTitle}}
  <button v-on:click="loadMENU">button</button>
</div>

javascript

var app2 = new Vue({
el: '#menuPage',

data: {
    HeaderTitle: 'NOT CHANGED',
    content_body: 'test body',
},
methods: {
    loadMENU: function () {

        app2 = this;
        const herf = window.location.href; 
        window.alert(herf);
        this.HeaderTitle = herf;

    }
} }); 

Leave a comment