vue watch array composition
import { watch, ref } from "vue";
import _ from "lodash";
export default {
setup() {
const secondLevel = ref([5, 6, 7]);
const level = ref([1, 2, 3, 4, secondLevel.value]);
watch(() => _.cloneDeep(level.value), (currentValue, oldValue) => {
console.log(currentValue);
console.log(oldValue);
}
);
},
};