K
K
K1NDER2020-08-25 11:46:41
JavaScript
K1NDER, 2020-08-25 11:46:41

Why is the Vue instance not updating?

var HUD = new Vue({
    el: ".inGameHud",
    data: {
        time: "00:00",
        date: "00.00.00"
    },
    methods: {
        setTime: (time, date) => {
            this.time = time;
            this.date = date;
    }
  }
});


As a result, 00.00.00 00:00 is displayed, why is the time not updated?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2020-08-25
@Kozack

You are not calling the setTime method anywhere

S
segio_tt, 2020-08-26
@art055

Mounted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question