refactor(仪表板): 优化预览模块自定义组件Picture的图片src

This commit is contained in:
wangjiahao 2023-10-30 19:38:20 +08:00
parent 54488bd163
commit 5f5c5c339a

View File

@ -3,7 +3,7 @@
<img
v-if="!showLink"
:style="imageAdapter"
:src="element.propValue"
:src="imgUrl"
>
<a
v-if="showLink"
@ -13,13 +13,15 @@
>
<img
:style="imageAdapter"
:src="element.propValue"
:src="imgUrl"
>
</a>
</div>
</template>
<script>
import { imgUrlTrans } from '@/components/canvas/utils/utils'
export default {
props: {
element: {
@ -33,6 +35,9 @@ export default {
}
},
computed: {
imgUrl() {
return imgUrlTrans(this.element.propValue)
},
showLink() {
return this.editMode === 'preview' && this.element && this.element.hyperlinks && this.element.hyperlinks.enable
},