V
V
Veiwai2021-06-09 14:41:13
Vue.js
Veiwai, 2021-06-09 14:41:13

How to overwrite a reactive object?

Reactive object created:

const item = reactive({})

I'm getting new data from the server, how can I completely overwrite this object?

item = response

Now vetur swears:

Cannot assign to 'item' because it is a constant.Vetur(2588)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2021-06-09
@Veiwai

Use ref instead of reactive.

N
nvdfxx, 2021-06-09
@nvdfxx

const -> let?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question