vue中关于this.$se的用法
<template>
<div>
<div v-for="(item,index) in list"
:key="index">
{{item.name}}
</div>
<el-button @click="changeValue" type="primary">改变值</el-button>
</div>
</template>
<script>
export default {
data() {
return {
list :[
{name: 'meihua', id : 1},
{name: 'taohua', id : 2}
]
}
},
methods:{
changeValue(){
// this.$set(this.list,2, {name:'andy',id:1})
this.list.push({name:'wilson',id:3})
}
}
}
</script>
因篇幅问题不能全部显示,请点此查看更多更全内容