问题描述:点击回复按钮,它却显示了所有的输入框,怎么只显示自己子DOM元素下的输入框
这是我的组件的js代码
<script>
export default{
props:['object_id','count'],
mounted(){
this.$http.post('/comment/init/'+this.object_id).then(response=>{
this.comment = response.data;
});
},
data: function () {
return{
show: false,
comment:[]
}
},
methods:{
// like(){
// this.$http.post('/api/collection',{'object':this.article,'user':this.user}).then(response=>{
// this.liked = response.data.liked;
// });
// }
create(){
this.$http.post('/comment/create',{'object_id':this.object_id,
'body':this.body,
'object_type':0,
'parent_id':0}).then(response=>{
});
},
isShow(){
if(!this.show){
this.show = true;
}
}
}
}
</script>
这是回复按钮代码
<a @click="isShow" class="vote-btn" href="javascript:;">
回复
</a>
这是回复框
<transition name="slide-fade">
<div class="widget-comments mb-20"
v-if="show">
<div class="widget-comment-form row">
<div>
<div class="form-group col-md-12">
<textarea rows="2" name="content" placeholder="请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。" class="form-control"
v-model="body"></textarea>
</div>
<div class="col-md-12 text-right">
<input type="hidden" name="reply_comment_id" value="35">
<button type="submit" class="Button Button--blue">评论</button>
</div>
</div>
</div>
</div>
</transition>