码迷,mamicode.com
首页 > 其他好文 > 详细

V-demo item.vue

时间:2020-07-03 21:09:09      阅读:68      评论:0      收藏:0      [点我收藏+]

标签:default   let   flow   cccccc   lock   win   handle   ref   class   

<template>
<div>
<li class="list-group-item">
<div class="handle">
<a href="#" @click="deleteItem">删除</a>
</div>
<p class="user"><span>{{comment.name}}</span><span>说:</span></p>
<p class="centence">{{comment.content}}</p>
</li>

</div>
</template>

<script>
export default{
props:{
comment:Object,
deleteComment:Function,
index:Number
},
methods:{
deleteItem(){
const {comment,index,deleteComment}=this
if(window.confirm(`确定删除${comment.content}的评论吗`)){
deleteComment(index)
}
}
}
}
</script>

<style>
li{
transition: .5s;
overflow: hidden;
}
.handle{
width: 40px;
border: 1px solid #CCCCCC;
background-color: #ffff;
position: absolute;
right: 10px;
top:1px;
text-align: center;
}
.handle a{
display: block;
}
</style>

V-demo item.vue

标签:default   let   flow   cccccc   lock   win   handle   ref   class   

原文地址:https://www.cnblogs.com/weixin2623670713/p/13232490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!