Popescu-Andrei
1 year ago
60
2
Vue

Disable reactivity

Posted 1 year ago by Popescu-Andrei

I built a recursive tree that supports drag and drop.

I have this in app.js.

const app = new Vue({ data() { return { tree : [], treeInitial:[] } }, created() { axios.get('/tree') .then(({data}) => { this.tree=data; this.treeInitial=data; }); }, el: '#app' });

When i change anything in the tree array ( ), the treeInitial changes too. Any idea how may i prevent this?

Please sign in or create an account to participate in this conversation.