diff --git a/packages/uni-api/src/protocols/ui/showActionSheet.ts b/packages/uni-api/src/protocols/ui/showActionSheet.ts index 28fe8631f2d93c1326cc1311e5b52fd622d2eb9e..8c0109365e665a81bd5b8a4b05055ed2fd939cf3 100644 --- a/packages/uni-api/src/protocols/ui/showActionSheet.ts +++ b/packages/uni-api/src/protocols/ui/showActionSheet.ts @@ -7,7 +7,6 @@ export const ShowActionSheetProtocol: ApiProtocol = required: true, }, title: String, - alertText: String, itemColor: String, popover: Object, } diff --git a/packages/uni-app-plus/src/service/api/ui/popup/showActionSheet.ts b/packages/uni-app-plus/src/service/api/ui/popup/showActionSheet.ts index ef73cdf4990627a4b037211374407b4af11409b0..898bc6323bf78b10f954f81be96a655f4b27ed83 100644 --- a/packages/uni-app-plus/src/service/api/ui/popup/showActionSheet.ts +++ b/packages/uni-app-plus/src/service/api/ui/popup/showActionSheet.ts @@ -11,13 +11,7 @@ import { initI18nShowActionSheetMsgsOnce, useI18n } from '@dcloudio/uni-core' export const showActionSheet = defineAsyncApi( API_SHOW_ACTION_SHEET, ( - { - itemList = [], - itemColor = '#000000', - title = '', - alertText = '', - popover, - }, + { itemList = [], itemColor = '#000000', title = '', popover }, { resolve, reject } ) => { initI18nShowActionSheetMsgsOnce() @@ -30,9 +24,6 @@ export const showActionSheet = defineAsyncApi( color: itemColor, })), } - if (title || alertText) { - options.title = alertText || title - } plus.nativeUI.actionSheet( extend(options, { popover, diff --git a/packages/uni-h5/src/service/api/ui/popup/actionSheet.tsx b/packages/uni-h5/src/service/api/ui/popup/actionSheet.tsx index 0941bd1bf9a3f3f51219714f9462bdd5a3582106..55f6b691809006b89b1d11007efa9d3447a901a0 100644 --- a/packages/uni-h5/src/service/api/ui/popup/actionSheet.tsx +++ b/packages/uni-h5/src/service/api/ui/popup/actionSheet.tsx @@ -9,7 +9,6 @@ import { watchEffect, nextTick, Transition, - computed, } from 'vue' import { usePopupStyle } from '../../../../helpers/usePopupStyle' import { useKeyboard } from '../../../../helpers/useKeyboard' @@ -30,10 +29,6 @@ const props = { type: String, default: '', }, - alertText: { - type: String, - default: '', - }, itemList: { type: Array, default() { @@ -140,14 +135,12 @@ export default /*#__PURE__*/ defineComponent({ $event.preventDefault() } - const fixTitle = computed(() => props.title || props.alertText) - watch( () => props.visible, () => { nextTick(() => { // title 占位 - if (fixTitle.value) { + if (props.title) { titleHeight.value = ( document.querySelector('.uni-actionsheet__title') as HTMLElement ).offsetHeight @@ -189,13 +182,13 @@ export default /*#__PURE__*/ defineComponent({ onWheel={_handleWheel} > {/* title占位 */} - {fixTitle.value ? ( + {props.title ? ( <>
-
{fixTitle.value}
+
{props.title}
) : ( ''