更新记录
1.0.0.2(2025-12-30)
下载此版本
属性更改
1.0.0.1(2025-12-30)
下载此版本
master
1.0.0(2025-12-30)
下载此版本
master
查看更多
平台兼容性
uni-app(4.45)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| √ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
其他
安装
在市场导入xf-dialog uni_modules版本的即可,无需import
组件关联说明
代码演示
插件使用
基本用法
<template>
<view class="main-page xf-col">
<view class="xf-col" style="margin-top: 10px;">
<xf-button isFull class="b-mt16" text="对话框-D1" @click="showDialog('D1')"></xf-button>
<xf-button isFull class="b-mt16" text="对话框-D2" @click="showDialog('D2')"></xf-button>
<xf-button isFull class="b-mt16" text="对话框-D3" @click="showDialog('D3')"></xf-button>
</view>
<xf-dialog ref="xfDialogRef"></xf-dialog>
</view>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue';
const xfDialogRef = ref(null)
const showDialog = (type : string) => {
xfDialogRef.value.show({
type: type,
title: "弹窗的标题",
content: "内容描述内容描述内容描述内容描述内容描述内容描述",
confirm: (e) => {
console.log(e)
}
})
}
</script>
<style lang="scss" scoped>
.b-mt16{
margin-top: 10px;
}
</style>
外部调用事件 Expose
show方法参数
| 属性名 |
说明 |
类型 |
默认值 |
| type |
类型D1|D2|D3 |
string |
D1 |
| title |
显示标题 |
string |
- |
| content |
显示内容 |
string |
- |
| cancelText |
左边按钮文本 |
string |
取消 |
| confirmText |
右边按钮文本 |
string |
确定 |
| confirm |
点击右边确定按钮回调事件 |
func |
- |
| cancel |
点击左边取消按钮回调事件 |
func |
- |
| close |
点击关闭回调事件 |
func |
- |