提问题框图片加载失败问题

This commit is contained in:
lmj
2022-10-20 11:02:31 +08:00
parent 7c53d950f5
commit 975436b387
2 changed files with 17 additions and 6 deletions

View File

@@ -13,10 +13,10 @@
<el-input class="title-input" v-model="askForm.title" show-word-limit placeholder="请输入问题标题,字符长度不能高于100" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="封面">
<imageUpload dir="qa" width="410px" height="168px" :value="imageShowUrl" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></imageUpload>
<imageUpload :value="imageShowUrl" dir="qa" width="410px" height="168px" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></imageUpload>
<!-- <el-upload
:action="uploadFileUrl"
:show-file-list="false"
:show-file-list="false"
:headers="headers"
list-type="picture-card"
:on-success="handleAvatarSuccess"
@@ -67,6 +67,7 @@
export default{
data(){
return {
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
askFormCheckedShow:false,
askFormRules: {
title: [{ required: true, message: '请输入问题标题', trigger: 'blur' }, { max: 100, message: '字符长度不能高于100', trigger: 'blur' }],
@@ -91,8 +92,10 @@
},
handleUploadSuccess(file) {
// console.log(file.result.httpPath,'是否会fig以后关于和',file.result.filePath)
this.imageShowUrl=file.result.httpPath;
this.askForm.images=file.result.filePath
this.imageShowUrl= this.fileBaseUrl + file.result.filePath;
// console.log(this.fileBaseUrl)
console.log(file)
},
handleRemoveSuccess(file) {
this.imageShowUrl=''