Skip to content
加载中...

T-Modal 模态框

兼容端

安卓苹果Web鸿蒙微信小程序

使用示例

vue
<template> 
  <t-modal content="Turbo UI 对话框" v-model:show="state.show1">
    <template v-slot:click>
      <t-button type="primary">默认对话框</t-button>
    </template>
  </t-modal>
</template>
<script setup lang="uts">
  type stateType = {
    show1: boolean
  }
  const state = reactive<stateType>({
    show1: false
  })
</script>

属性

属性名类型默认值说明
zIndexNumber999窗口层级
titleString"标题"标题
showBooleanfalse显示窗口
bgColorString''背景颜色
darkBooleantrue是否开启暗黑模式
heightString"auto"对话框高度
widthString"300"对话框宽度
roundArray['10','10']对话框圆角
paArray['10','10']对话框内边距
contentString""对话框内容
contentHeightString"30"对话框内容高度
maskColorString"rgba(0,0,0,0.1)"遮罩背景色

方法

方法名说明参数
update:show更新显示状态Boolean: 显示/隐藏状态
cancel取消事件-
confirm确认事件-

插槽

插槽名说明
click触发模态框显示的元素插槽
title标题区域插槽
content内容区域插槽
btn按钮区域插槽