Commit e9489f9a by hank

修改keppalive bug

parent b637e69d
<template> <template>
<div id="app"> <div id="app">
<keep-alive v-if="$route.meta.keepAlive"> <keep-alive >
<router-view class="child-view" /> <router-view class="child-view" />
</keep-alive> </keep-alive>
<router-view class="child-view" v-if="!$route.meta.keepAlive" /> <!-- <router-view class="child-view" v-if="!$route.meta.keepAlive" /> -->
<!-- <transition :name="transitionName" > <!-- <transition :name="transitionName" >
</transition>--> </transition>-->
......
...@@ -264,22 +264,23 @@ ...@@ -264,22 +264,23 @@
<draggable <draggable
class="page-list-container" class="page-list-container"
:scroll="true" :scroll="true"
:delay="0" :delay="500"
draggable=".page-item"
group="listData" group="listData"
@change="dragChange" @change="dragChange"
:list="templateData.listData" :list="templateData.listData"
> >
<div class="page-item" v-for="(item, index) in templateData.listData" :key="index"> <div class="page-item" v-for="(item, index) in templateData.listData" :key="index">
<div name="clear" class="delete-page" @click="deletePage(index)"></div> <div name="clear" class="delete-page" @click="deletePage(index)"></div>
<div <div class="page-item-item">
:src="item.thumb" <div
class="img" :src="item.thumb"
:style="{'background': `url(${item.thumb}) no-repeat center` }" class="img"
alt :style="{'background': `url(${item.thumb}) no-repeat center` }"
:class="{'page-item-thumb': templateData.templateShow !== 'HORIZONTAL'}" alt
></div> :class="{'page-item-thumb': templateData.templateShow !== 'HORIZONTAL'}"
<div class="name">{{item.name}}</div> ></div>
<div class="name">{{item.name}}</div>
</div>
</div> </div>
</draggable> </draggable>
</div> </div>
...@@ -519,7 +520,7 @@ export default { ...@@ -519,7 +520,7 @@ export default {
// 放页面拖拽发生时执行 // 放页面拖拽发生时执行
this.message({ this.message({
type: "setList", type: "setList",
pages: this.templateData.listData pages: this.templateData.listData
}); });
}, },
setList() { setList() {
...@@ -647,7 +648,7 @@ export default { ...@@ -647,7 +648,7 @@ export default {
this.loaded = true; this.loaded = true;
}, },
iframeLoad() { iframeLoad() {
this.$toast.clear() this.$toast.clear();
this.gifloaded = true; this.gifloaded = true;
this.iframeLoaded = true; this.iframeLoaded = true;
this.setList(); this.setList();
...@@ -817,8 +818,8 @@ export default { ...@@ -817,8 +818,8 @@ export default {
}, },
enterSubmit() { enterSubmit() {
if (Object.values(this.$store.getters.errorData).length) { if (Object.values(this.$store.getters.errorData).length) {
alert('当前编辑项数据不符合定义规则,请修改后发布!') alert("当前编辑项数据不符合定义规则,请修改后发布!");
return return;
} }
this.$toast.loading({ this.$toast.loading({
overlay: true, overlay: true,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="content"> <div class="content">
<div class="content-left"> <div class="content-left">
<iframe <iframe
@load="getData" @load="setDataList"
class="iframe preview-iframe" class="iframe preview-iframe"
v-if="loaded" v-if="loaded"
id="previewiframe" id="previewiframe"
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
this.$router.back(); this.$router.back();
}, },
message(data) { message(data) {
console.log(window.frames["previewiframe"], "12313132");
window.frames["previewiframe"].postMessage( window.frames["previewiframe"].postMessage(
data, data,
"https://visual-clouds.bdideal.com" "https://visual-clouds.bdideal.com"
...@@ -81,11 +82,12 @@ export default { ...@@ -81,11 +82,12 @@ export default {
getData() { getData() {
this.templateData = JSON.parse(window.localStorage.getItem("preview")); this.templateData = JSON.parse(window.localStorage.getItem("preview"));
this.loaded = true; this.loaded = true;
},
setDataList() {
console.log('setDataList')
this.message({ this.message({
type: "setList", type: "setList",
pages: this.templateData.listData, pages: JSON.parse(JSON.stringify(this.templateData.listData))
list: this.templateData.listData
}); });
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment