[Vuejs]-Cannot empty Vue computed array property

0👍

That’s what computed properties are for – https://v2.vuejs.org/v2/guide/computed.html#Computed-vs-Watched-Property

You just can watch some values in the function of the computed property.

In your case:

computed: {
    rowEndTime: function() {
        var rowTime = [];
        for (var i = this.form.numStartTime; i < 19; i++) {
            rowTime.push(i);
        }
        return rowTime;
    }
}

Leave a comment