我的页和设置页完成
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
<script>
|
||||
import {previewFile, previewCacheThumbImage} from'@/api/common.js'
|
||||
import {get_base_url} from '@/api/request.js'
|
||||
export default {
|
||||
name:"image-preview",
|
||||
props:{
|
||||
@@ -11,6 +12,10 @@
|
||||
default:'',
|
||||
type:String
|
||||
},
|
||||
src:{
|
||||
default:'',
|
||||
type:String
|
||||
},
|
||||
width:{
|
||||
default:50,
|
||||
type:[String, Number]
|
||||
@@ -27,7 +32,8 @@
|
||||
data() {
|
||||
return {
|
||||
imgUrlShow: '',
|
||||
watching: false
|
||||
watching: false,
|
||||
base_url: get_base_url()
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -39,6 +45,15 @@
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
src: {
|
||||
handler(newval, oldval) {
|
||||
if (newval && this.watching) {
|
||||
this.imgUrlShow = this.base_url + this.src
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -70,6 +85,9 @@
|
||||
this.getPreviewUrlBlob(this.imgId);
|
||||
}
|
||||
this.watching = true
|
||||
if(this.src) {
|
||||
this.imgUrlShow = this.base_url + this.src
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user