add max height and disabled button

This commit is contained in:
Timi
2026-10-30 10:46:30 +08:00
parent dc61f29323
commit 817994953f
2 changed files with 13 additions and 3 deletions
+9 -3
View File
@@ -1,10 +1,10 @@
<template>
<t-popup v-model="visible" placement="bottom" :z-index="props.zIndex" :overlay-props="props.overlayProps">
<div class="bottom-popup" :style="{ height: props.height }">
<div class="bottom-popup" :style="{ height: props.height, maxHeight: props.maxHeight }">
<div v-if="hasHeader" class="header">
<div class="button left">
<slot name="leftButton" :on-click="emitLeftButtonClick">
<t-button v-if="leftButtonText" variant="text" size="small" @click="emitLeftButtonClick">
<t-button v-if="leftButtonText" variant="text" size="small" :disabled="props.leftButtonDisabled" @click="emitLeftButtonClick">
<span v-text="leftButtonText" />
</t-button>
</slot>
@@ -16,7 +16,7 @@
</div>
<div class="button right">
<slot name="rightButton" :on-click="emitRightButtonClick">
<t-button v-if="rightButtonText" theme="primary" variant="text" size="small" @click="emitRightButtonClick">
<t-button v-if="rightButtonText" theme="primary" variant="text" size="small" :disabled="props.rightButtonDisabled" @click="emitRightButtonClick">
<span v-text="rightButtonText" />
</t-button>
</slot>
@@ -38,7 +38,13 @@ export interface BottomPopupProps {
modelValue?: boolean;
leftButtonText?: string;
rightButtonText?: string;
/** 禁用左侧默认按钮。 */
leftButtonDisabled?: boolean;
/** 禁用右侧默认按钮。 */
rightButtonDisabled?: boolean;
height?: string | number;
/** 弹层最大高度,数字以 px 为单位。 */
maxHeight?: string | number;
title?: string;
zIndex?: number;
overlayProps?: Record<string, unknown>;