mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +00:00
[bugfix] Popup modal display error
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<transition :name="currentTransition">
|
||||
<div v-show="currentValue" class="van-popup" :class="[position ? 'van-popup--' + position : '']">
|
||||
<div v-show="value" class="van-popup" :class="[position ? 'van-popup--' + position : '']">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</transition>
|
||||
@@ -8,29 +8,23 @@
|
||||
|
||||
<script>
|
||||
import Popup from '../mixins/popup';
|
||||
|
||||
export default {
|
||||
name: 'van-popup',
|
||||
|
||||
mixins: [Popup],
|
||||
|
||||
props: {
|
||||
transition: String,
|
||||
overlay: {
|
||||
default: true
|
||||
},
|
||||
|
||||
lockOnScroll: {
|
||||
default: false
|
||||
},
|
||||
|
||||
closeOnClickOverlay: {
|
||||
default: true
|
||||
},
|
||||
|
||||
transition: {
|
||||
type: String,
|
||||
default: 'popup-slide'
|
||||
},
|
||||
|
||||
position: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -38,31 +32,15 @@ export default {
|
||||
},
|
||||
|
||||
data() {
|
||||
const transition = this.transition || (this.position === '' ? 'popup-fade' : `popup-slide-${this.position}`);
|
||||
return {
|
||||
currentValue: false,
|
||||
currentTransition: this.transition
|
||||
currentTransition: transition
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentValue(val) {
|
||||
this.$emit('input', val);
|
||||
},
|
||||
|
||||
value(val) {
|
||||
this.currentValue = val;
|
||||
}
|
||||
},
|
||||
|
||||
beforeMount() {
|
||||
if (this.transition !== 'popup-fade') {
|
||||
this.currentTransition = `popup-slide-${this.position}`;
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.value) {
|
||||
this.currentValue = true;
|
||||
this.open();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user