——————————template
<div class="con">
<ul>
<li v-for="(item,index) in a" :key="index" @click="okk(index)" :class="{checked:current == index && current !== ''}">
<p>{{item.createTime}}</p>
<p>{{item.title}}</p>
</li>
</ul>
<button @click="add() ">添加</button>
<ul>
<li v-for="(item,index) in tarrget" :key="index">{{item}}
</li>
</ul>
<Icon type="ios-add-circle" />
</div>
____________data
return {
a:{},
current:'',
tarrget:[],
}
____________methods
add(){
this.tarrget.push(this.a[this.current]);
this.current='';
},
okk(index){
this.current=index
},
__________style
li.checked{
background: yellow;
}
网友评论