props: {
//指定属性名和属性值的类型
comment: Object,
deleteComment: Function,
index: Number
},
methods: {
deleteItem() {
const {comment, deleteComment, index} = this
if (window.confirm(`确定删除${comment.name}的评论吗?`)) {
deleteComment(index)
}
}
}
这样这里的符合不是单引号,是TAB
上面的那个符号