v-if 循环 改变数组 对象的方法

 v-if
 v-show  
 v-if v-else  
 v-if v-else-if v-else
 v-for="(item,index) in list" :key={{item}}  {{item}}

// 循环 1 - 10
 v-for="item in 10 "  

//1  改变数组的方法
     push()  pop()  shift() unshift()  reverse()

// 2  直接替换数组
     this.list  = [x,x,x,x]

// 3 直接更新数组的内容
    this.list[1] = 'buy'

// 对象的添加
this.listObj.age = 10
this.listObj.sex ='male'

// 无意义标签
<template> </template>
posted @ 2021-12-03 17:08  13522679763-任国强  阅读(171)  评论(0)    收藏  举报