Commit 69df35bf authored by Jenny's avatar Jenny

fix: 弹框关闭后清除数据

parent 2005a5c8
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
> >
<view class="slot-content"> <view class="slot-content">
<swiper <swiper
v-if="show"
class="swiper" class="swiper"
circular circular
:current="currentIndex" :current="currentIndex"
:style="{ height: `${height}px` }" :style="{ height: `${height}px` }"
> >
<swiper-item v-for="item in popupData"> <swiper-item v-for="(item, index) in popupData" :key="index">
<view v-for="(val, key) in item" :key="key" class="data-view"> <view v-for="(val, key) in item" :key="key" class="data-view">
<view class="data-key ellipsis">{{ key }}</view> <view class="data-key ellipsis">{{ key }}</view>
<template v-if="customRender[key] === 'picture'"> <template v-if="customRender[key] === 'picture'">
...@@ -69,6 +70,7 @@ export default { ...@@ -69,6 +70,7 @@ export default {
} }
}, },
height() { height() {
if (!this.popupData.length) return
const keys = Object.keys(this.popupData[0]) const keys = Object.keys(this.popupData[0])
const customRenderKeys = Object.keys(this.customRender) const customRenderKeys = Object.keys(this.customRender)
return keys.length * 30 + customRenderKeys.length * 50 return keys.length * 30 + customRenderKeys.length * 50
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
:popupData="popupData" :popupData="popupData"
:currentIndex="currentIndex" :currentIndex="currentIndex"
:customRender="customRender" :customRender="customRender"
@close="popupShow=false" @close="popupShow=false;popupData = []"
></ModelData> ></ModelData>
<MySelect></MySelect> <MySelect></MySelect>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
:popupData="popupData" :popupData="popupData"
:currentIndex="currentIndex" :currentIndex="currentIndex"
:customRender="customRender" :customRender="customRender"
@close="popupShow=false" @close="popupShow=false;popupData = []"
></ModelData> ></ModelData>
<MySelect></MySelect> <MySelect></MySelect>
......
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 to comment