|
|
@@ -34,48 +34,48 @@ const overflowScrollReg = /scroll|auto/i;
|
|
|
const popupProps = {
|
|
|
position: {
|
|
|
type: String,
|
|
|
- default: 'center',
|
|
|
+ default: 'center'
|
|
|
},
|
|
|
|
|
|
transition: String,
|
|
|
|
|
|
closeable: {
|
|
|
type: Boolean,
|
|
|
- default: false,
|
|
|
+ default: false
|
|
|
},
|
|
|
closeIconPosition: {
|
|
|
type: String,
|
|
|
- default: 'top-right',
|
|
|
+ default: 'top-right'
|
|
|
},
|
|
|
closeIcon: {
|
|
|
type: String,
|
|
|
- default: 'cross',
|
|
|
+ default: 'cross'
|
|
|
},
|
|
|
|
|
|
closeOnClickOverlay: {
|
|
|
type: Boolean,
|
|
|
- default: true,
|
|
|
+ default: true
|
|
|
},
|
|
|
|
|
|
destroyOnClose: {
|
|
|
type: Boolean,
|
|
|
- default: false,
|
|
|
+ default: false
|
|
|
},
|
|
|
getContainer: String,
|
|
|
round: {
|
|
|
type: Boolean,
|
|
|
- default: false,
|
|
|
- },
|
|
|
+ default: false
|
|
|
+ }
|
|
|
};
|
|
|
export default {
|
|
|
name: 'nut-popup',
|
|
|
mixins: [touchMixins],
|
|
|
components: {
|
|
|
- icon: Icon,
|
|
|
+ icon: Icon
|
|
|
},
|
|
|
props: {
|
|
|
...overlayProps,
|
|
|
- ...popupProps,
|
|
|
+ ...popupProps
|
|
|
},
|
|
|
created() {
|
|
|
this.transition ? (this.transitionName = this.transition) : (this.transitionName = `popup-slide-${this.position}`);
|
|
|
@@ -111,19 +111,19 @@ export default {
|
|
|
val === 'center' ? (this.transitionName = 'popup-fade') : (this.transitionName = `popup-slide-${this.position}`);
|
|
|
},
|
|
|
getContainer: 'portal',
|
|
|
- overlay: 'renderOverlay',
|
|
|
+ overlay: 'renderOverlay'
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
showSlot: true,
|
|
|
transitionName: 'popup-fade-center',
|
|
|
- overlayInstant: null,
|
|
|
+ overlayInstant: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
transitionDuration() {
|
|
|
return this.duration ? this.duration + 's' : 'initial';
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
if (this.opened) {
|
|
|
return;
|
|
|
}
|
|
|
- if(this.destroyOnClose){
|
|
|
+ if (this.destroyOnClose) {
|
|
|
this.showSlot = true;
|
|
|
}
|
|
|
this.opened = true;
|
|
|
@@ -144,7 +144,7 @@ export default {
|
|
|
overlayClass,
|
|
|
overlayStyle,
|
|
|
lockScroll,
|
|
|
- closeOnClickOverlay,
|
|
|
+ closeOnClickOverlay
|
|
|
};
|
|
|
|
|
|
this.renderOverlay(config);
|
|
|
@@ -206,13 +206,12 @@ export default {
|
|
|
if (!overlayManager.lockCount) {
|
|
|
document.body.classList.remove('nut-overflow-hidden');
|
|
|
}
|
|
|
- }
|
|
|
- if(this.destroyOnClose){
|
|
|
- setTimeout(()=>{
|
|
|
+ }
|
|
|
+ if (this.destroyOnClose) {
|
|
|
+ setTimeout(() => {
|
|
|
this.showSlot = false;
|
|
|
- },this.duration*1000)
|
|
|
+ }, this.duration * 1000);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
overlayManager.closeOverlay(this);
|
|
|
this.$emit('input', false);
|
|
|
@@ -235,8 +234,8 @@ export default {
|
|
|
if (container && container !== el.parentNode) {
|
|
|
container.appendChild(el);
|
|
|
}
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
export { popupProps };
|
|
|
</script>
|