提交 076c3b7f authored 作者: wangjiahao's avatar wangjiahao

fix: 编辑状态网页组件更换地址无法立即显示

上级 39503493
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { checkAddHttp } from '@/utils/urlUtils' import { checkAddHttp } from '@/utils/urlUtils'
import bus from '@/utils/bus'
export default { export default {
props: { props: {
...@@ -73,6 +74,7 @@ export default { ...@@ -73,6 +74,7 @@ export default {
this.linkInfoTemp.src = checkAddHttp(this.linkInfoTemp.src) this.linkInfoTemp.src = checkAddHttp(this.linkInfoTemp.src)
this.curComponent.frameLinks = this.linkInfoTemp this.curComponent.frameLinks = this.linkInfoTemp
this.$store.state.styleChangeTimes++ this.$store.state.styleChangeTimes++
bus.$emit('frameLinksChange-' + this.curComponent.id)
this.popoverClose() this.popoverClose()
}, },
onClose() { onClose() {
......
<template> <template>
<el-row class="main-frame"> <el-row class="main-frame">
<div v-if="element.frameLinks.src" class="main-frame"> <div v-if="element.frameLinks.src" class="main-frame">
<iframe id="iframe" :src="element.frameLinks.src" scrolling="auto" frameborder="0" class="main-frame" @load="loaded" @error="onError" /> <iframe v-if="frameShow" id="iframe" :src="element.frameLinks.src" scrolling="auto" frameborder="0" class="main-frame" @load="loaded" @error="onError" />
<div v-if="editMode==='edit'" class="frame-mask"> <div v-if="editMode==='edit'" class="frame-mask">
<span style="opacity: 1;"> <span style="opacity: 1;">
<span style="font-weight: bold;color: lawngreen;">{{ $t('panel.edit_web_tips') }}</span> <span style="font-weight: bold;color: lawngreen;">{{ $t('panel.edit_web_tips') }}</span>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import NProgress from 'nprogress' import bus from '@/utils/bus'
export default { export default {
name: 'DeFrame', name: 'DeFrame',
props: { props: {
...@@ -45,7 +45,8 @@ export default { ...@@ -45,7 +45,8 @@ export default {
}, },
data() { data() {
return { return {
pOption: {} pOption: {},
frameShow: true
} }
}, },
...@@ -62,6 +63,12 @@ export default { ...@@ -62,6 +63,12 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
bus.$on('frameLinksChange-' + this.element.id, () => {
this.frameShow = false
this.$nextTick(() => {
this.frameShow = true
})
})
}, },
methods: { methods: {
loaded(e) { loaded(e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论