Skip to content

底部对话框 xActionModal


在线预览
在线模拟尺寸:

介绍

样式与darawer不一样,风格更为圆润精致,适于提醒框,阅读对话框等场景。

平台兼容

H5andriodIOS小程序UTSUNIAPP-X SDKversion
☑️☑️☑️☑️4.44+1.1.9

文件路径

ts

@/uni_modules/tmx-ui/components/x-action-modal/x-action-modal.uvue

使用

ts

<x-action-modal></x-action-modal>

Props 属性

名称说明类型默认值
customStyle自定义遮罩样式string""
title标题string"标题"
showTitle是否显示底部关闭按钮booleantrue
showClose是否显示关闭booleanfalse
overlayClick遮罩是否允许点击被关闭booleantrue
show显示可v-model:show双向绑定booleanfalse
showConfirm显示取消按钮booleantrue
duration动画时间number350
round打开方向为上和下时的圆角<br>空值时,取全局配置的圆角。注意是取drawer的圆角,统一弹层的圆角string""
maxHeight弹层最大的高度值,默认为屏幕的可视高<br>提供值时不能为百分比,可以是px,rpx单位数字。如果你不带单位,默认转换为rpx单位。string""
bgColor弹层的背景string"white"
darkBgColor弹层的暗黑背景,如果为空取sheetDarkColorstring""
btnColor空值取全局主题值。string""
btnText确认按钮的文本string"确认"
btnFontColor空值最自动计算文本色。string""
watiDuration打开dom的延迟量,如果你打开 弹窗在ios正常。<br>请不要修改此值。如果遇到打不开,或者 打开 后没动画,关闭不了等可能是sdk bug导致 <br>此时需要加大值来避免。具体加多少以你弹窗内的节点复杂度有关,需要你自行压力测试。<br>此值仅在ios下生效。number120

Events 事件

名称参数说明
confirm-底部按钮被点击时触发
click-点击遮罩事件
close-关闭时执行
open-打开执行的事件
beforeOpen-打开前执行
beforeClose-关闭前执行
update:show-等同v-model:show

Slots 插槽

名称说明数据
trigger标签触发显示遮罩,免于使用变量控制show : Boolean
title标题插槽show : Boolean
default默认插槽-
footer页脚按钮插槽-

Ref 方法

名称参数返回值说明

示例文件路径

json

/pages/fankui/action-modal

示例源码

uvue
vue
<template>
	<!-- #ifdef APP -->
	<scroll-view style="flex:1">
	<!-- #endif -->
	<!-- #ifdef MP-WEIXIN -->
	<page-meta :page-style="`background-color:${xThemeConfigBgColor}`">
		<navigation-bar :background-color="xThemeConfigNavBgColor" :front-color="xThemeConfigNavFontColor"></navigation-bar>
	</page-meta>
	<!-- #endif -->
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b mb-8">底部对话框 ActionModal</x-text>
			<x-text color="#999999" >
				样式与darawer不一样,风格更为圆润精致,适于提醒框,阅读对话框等场景。
			</x-text>
		</x-sheet>
		<x-sheet>
			<x-action-modal :show="showModal" title="技巧提醒" btn-text="我知道了哇">
				<template #trigger>
					<x-button :block="true">显示技巧提醒</x-button>
				</template>
			
				<x-sheet class="flex flex-col flex-col-center-center">
					<x-icon font-size="96" color="primary" name="pantone-fill"></x-icon>
					<x-text font-size="18" class="text-weight-b">你学会了吗?</x-text>
					<x-text class="text-align-center text-grey">风格与drawer样式不同的是两边和底部有间隙?风格是否喜欢呢?</x-text>
				</x-sheet>
			</x-action-modal>
		</x-sheet>
	<!-- #ifdef APP -->
	</scroll-view>
	<!-- #endif -->
</template>

<script>
	export default {
		data() {
			return {
				showModal: false
			};
		},
		onReady() {
			this.showModal = true;
		}
	}
</script>

<style lang="scss">

</style>
最近更新