| | |
| | | <template> |
| | | <view v-if="showPopup" class="y-popup-mask" @tap="onTop"> |
| | | <view class="center"> |
| | | <scroll-view scroll-y="true" class="" style="max-height: 80vh;"> |
| | | <slot/> |
| | | </scroll-view> |
| | | </view> |
| | | <view v-if="showPopup"> |
| | | <uni-transition key="1" mode-class="fade" :styles="maskClass" :show="show" @click="onTop"/> |
| | | <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" :show="showTrans" > |
| | | qqq<view style="width: 500rpx;height: 300rpx;background-color: aliceblue;position: absolute;top: 0; |
| | | left: 0;"><slot /></view> |
| | | </uni-transition> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | name: 'y-popup', |
| | | data() { |
| | | return { |
| | | show:false, |
| | | showPopup:false, |
| | | showTrans: false, |
| | | duration: 300, |
| | | ani: [], |
| | | maskClass: { |
| | | position: 'fixed', |
| | | bottom: 0, |
| | | top: 0, |
| | | left: 0, |
| | | right: 0, |
| | | backgroundColor: 'rgba(0, 0, 0, 0.4)' |
| | | }, |
| | | transClass: { |
| | | position: 'fixed', |
| | | left: 0, |
| | | right: 0 |
| | | }, |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | open(direction) { |
| | | this.showPopup = true |
| | | this.show = true |
| | | this.showTrans = true |
| | | }, |
| | | close() { |
| | | this.showPopup = false |