How to modify a value in a multidimensional array under data under vue?

data
tour[0]children[0]value


:http://nbdm.net/vue.html
:

Mar.19,2022

Tip: if you use layui, you'd better not use vue.js,layui to have your own way of dealing with forms. However, if you want to use the vue.set () method to modify the worthwhile words, you will have to traverse the array once:

var arr = [{ id:1,name:[{ value:"123"}]}];
arr.map((item) => {
    Vue.set(item.name,value,'456');
})
//splice()
arr.splice(0,1,{ name:[{ value:"456"}]});
//

< H1 > the test passed < / H1 >
  

use Vue.$set

Menu