更新记录

1.0.1(2025-05-06) 下载此版本

优化

1.0.0(2025-05-06) 下载此版本

popup弹框 modal模态框


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
app-vue app-nvue × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序 鸿蒙元服务
× × × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari

d-popup使用说明

<button @click="handlePopup">弹框</button>
<d-popup ref="popupRef">
    <view style="height: 700rpx;">我是弹框</view>
</d-popup>
import { ref } from 'vue'

const popupRef = ref()
const handlePopup = () => {
    popupRef.value.open()
}

属性说明

名称 类型 默认值 描述
mode string bottom 弹出方向 top, bottom, left, right
radius string / number 30 圆角 单位rpx
isClickOverlay boolean true 点击遮罩层是否关闭
safeBottom boolean true mode==bottom时底部安全区是否开启
customStyle string 自定义样式
@change Function 弹框显示隐藏的回调

d-modal使用说明

<button @click="handleModal">模态框</button>
<d-modal ref="modalRef"></d-modal>
import { ref } from 'vue'

const modalRef = ref()
const handleModal = () => {
    modalRef.value.open({
        title: '模态框',
        content: '内容内容内容内容内容内容内容内容内容内容内容内容',
        success(res) {
            if(res.confirm) {
                console.log('确定')
            }else if(res.cancel) {
                console.log('取消')
            }
        }
    })
}

属性说明

名称 类型 默认值 描述
title string 温馨提示 标题 为空时不显示
content string 内容
cancelText string 取消 左侧按钮 为空时不显示
cancelColor string #eeeeee 左侧按钮背景颜色
cancelTextColor string #333333 左侧按钮文字颜色
confirmText string 确定 右侧按钮
confirmColor string #3c9cff 右侧按钮背景颜色
confirmTextColor string #ffffff 右侧按钮文字颜色
width number 580 模态框宽度 单位rpx
success Function 模态框按钮回调

插槽

名称 描述
default 替换content内容区
title 替换title标题

d-transition使用说明

<button @click="handleTransition">动画</button>
<d-transition :show="show" mode="fadeInUp">
    <view style="width: 100rpx; height: 100rpx; background: skyblue"></view>
</d-transition>
import { ref } from 'vue'

const show = ref(false)
const handleTransition = () => {
    show.value = !show.value
}

属性说明

名称 类型 默认值 描述
show boolean false 动画显示隐藏
mode string fadeIn 动画方式 fadeIn / fadeInDown / fadeInUp / fadeInLeft / fadeInRight / slideInDown / slideInUp / slideInLeft / slideInRight / zoomIn

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问