Different added to the array of objects inside the same key value

 

Scenario: backing field does not send you to add your own data

 <div v-for="item in list" :key="item.id">
      <p>{{ item.id}} ----> {{ item.name}} --->{{ item.sex }}---> {{ item.tel }}---->{{ item.link}}--插入数据</p>
 </div>

  

  var vm = new Vue({
            el:"#app",
            data: {
                list: [{
                        id: 1,
                        name: "张三1",
                        sex: "男",
                        tel: "18383838388"
                    },
                    {
                        id: 2,
                        name: "张三1",
                        sex: "男",
                        tel: "18383838388"
                    }, 
                    { 
                        ID: . 3 , 
                        name: "Joe Smith. 1" , 
                        Sex: "M" , 
                        Tel: "18,383,838,388" 
                    } 
                ], 
                CON: [ "www11", "56456", "123" ] 
                
            }, 

            Created () { 
                for ( var I = 0; I < the this .list.length; I ++ ) {
                     // to add an array of attributes and attribute values 
                    the this .list [I] [ "Link"]=this.con[i];
                }
                console.log(this.list)
            },

        })

 

Guess you like

Origin www.cnblogs.com/IwishIcould/p/11261369.html