riku
2024-11-14 00a96d6881dd10ae7d3c4f5437bfceaabe677723
miniprogram_npm/tdesign-miniprogram/popup/popup.js
@@ -8,6 +8,7 @@
import config from '../common/config';
import props from './props';
import transition from '../mixins/transition';
import useCustomNavbar from '../mixins/using-custom-navbar';
delete props.visible;
const { prefix } = config;
const name = `${prefix}-popup`;
@@ -15,7 +16,7 @@
    constructor() {
        super(...arguments);
        this.externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
        this.behaviors = [transition()];
        this.behaviors = [transition(), useCustomNavbar];
        this.options = {
            multipleSlots: true,
        };
@@ -25,15 +26,14 @@
            classPrefix: name,
        };
        this.methods = {
            onStopPropagation() { },
            handleOverlayClick() {
                const { closeOnOverlayClick } = this.properties;
                if (closeOnOverlayClick) {
                    this.triggerEvent('visible-change', { visible: false });
                    this.triggerEvent('visible-change', { visible: false, trigger: 'overlay' });
                }
            },
            handleClose() {
                this.triggerEvent('visible-change', { visible: false });
                this.triggerEvent('visible-change', { visible: false, trigger: 'close-btn' });
            },
        };
    }