VUE问题记录-Method调用不报错但是没有执行任何逻辑,日志也输出不了

我是下面这种结构,一直调不出问题,console.log也输出不了日志,检查很久才发现,methods有两个,底下的methods应该是后执行,导致覆盖了前面的methods

我有点无语,Vue的对语法要求这么宽松吗?这都不报个错,还让我一遍遍的运行调试…

export default {
    methods: {     //<----------------------------------------------
        beforeUpload(file) {
            console.log("?")
            let xfile = null;

            // 发送并等待返回
            this.$emit('beforeUpload', file, returnValue => {
                xfile = returnValue;
            });
            return xfile
        },
        handleChange(file) {
            console.log("?")
            this.$emit('handleChange', file)
            this.fileList = [file.raw];

        },
        handleRemove(file) {
            console.log("?")
            this.$emit('handleRemove', file)
            this.fileList = [];

        }

    },
    watch: {
        fileList: {
            handler: function (newValue, oldValue) {
                this.$emit("updateFileList", newValue)
                console.log("?")
            }
        },
    },
    data() {
        return {
            fileList: [],

        }
    },
    methods: {   //<----------------------------------------------
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值