Skip to content

Commit b2bea2c

Browse files
committed
在刷新时使用replace加载iframe避免产生历史
1 parent 5d4a481 commit b2bea2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/views/instance/components/instance.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ export default {
184184
if (!isMD) {
185185
if (this.iframeInit) {
186186
// 在非markdown模式下必须重新加载iframe来避免上一次执行的javascript代码影响到新代码的执行结果
187-
iframe.src += ''
187+
iframe.contentWindow.location.replace(iframe.src)
188+
// iframe.src += ''
188189
// 使用reload重载似乎在新版chrome和edge中会加载外部的vueApp,因此使用src代替
189190
// iframe.contentWindow.location.reload()
190191
const consoleSettings = this.consoleSettings

0 commit comments

Comments
 (0)