把选择的图片文件显示在页面上

vue方法来写


logoChange(){
    let file = this.$refs.logoFile.files[0]
    let _this = this;
    let read = new FileReader()
    read.readAsDataURL(file)
    read.onload = function(){
        _this.imageUrl = read.result
    }
},

 

你可能感兴趣的:(前端笔记)