[Vuejs]-Toggle property of an element inside an array VueJS?

0👍

tbh, I can’t really follow your intent, but based on the comments, perhaps you want to watch the inputArray and execute code based on changes to its length.

watch: {
    inputArray(newValue, oldValue) {
        if ((newValue.length !== oldValue.length) && (newValue.length === 1)) {
            this.inputArray[0].toggle = !this.inputArray[0].toggle;
        }
    }
}

Leave a comment