|
@@ -67,7 +67,7 @@ export default {
|
|
addImg() {
|
|
addImg() {
|
|
// 上传图片进行压缩,压缩后超过4M则不允许上传
|
|
// 上传图片进行压缩,压缩后超过4M则不允许上传
|
|
let fileTag = this.$refs.inp;
|
|
let fileTag = this.$refs.inp;
|
|
- let img = this.$refs.img;
|
|
|
|
|
|
+ // let img = this.$refs.img;
|
|
let file = fileTag.files[0];
|
|
let file = fileTag.files[0];
|
|
const that = this;
|
|
const that = this;
|
|
this.imgBase64(file, function (image, canvas) {
|
|
this.imgBase64(file, function (image, canvas) {
|
|
@@ -97,7 +97,8 @@ export default {
|
|
that.$store.commit('setImgSrc', { key: key, src: uploadSrc, type: that.moduleType })
|
|
that.$store.commit('setImgSrc', { key: key, src: uploadSrc, type: that.moduleType })
|
|
that.$previewRefresh(); //异步获取的图片需要刷新下
|
|
that.$previewRefresh(); //异步获取的图片需要刷新下
|
|
}
|
|
}
|
|
- that.$refs.inp.value = '';
|
|
|
|
|
|
+ // that.$refs.inp.value = '';
|
|
|
|
+ fileTag.value = '';
|
|
});
|
|
});
|
|
},
|
|
},
|
|
imgBase64(file, callback) {
|
|
imgBase64(file, callback) {
|