vue使用es6语法保存vue的内容

  props: {
        //指定属性名和属性值的类型
        comment: Object,
        deleteComment: Function,
        index: Number
    },
    methods: {
        deleteItem() {
            const {comment, deleteComment, index} = this
            if (window.confirm(`确定删除${comment.name}的评论吗?`)) {
                deleteComment(index)
            }
        }
    }

这样这里的符合不是单引号,是TAB上面的那个符号

猜你喜欢

转载自blog.csdn.net/qq_36939013/article/details/90948584
今日推荐