fix: ListPage 的关闭按钮

This commit is contained in:
unanmed 2025-05-27 21:12:19 +08:00
parent dd0f596e21
commit 99432d4fd3
2 changed files with 12 additions and 2 deletions

View File

@ -121,6 +121,8 @@ export interface ListPageProps extends ListProps {
right?: boolean;
/** 是否显示关闭按钮 */
close?: boolean;
/** 关闭按钮的位置,相对于组件定位 */
closeLoc?: ElementLocator;
}
export type ListPageEmits = {
@ -145,7 +147,9 @@ const listPageProps = {
'winskin',
'color',
'border',
'alphaRange'
'alphaRange',
'close',
'closeLoc'
],
emits: ['update', 'update:selected', 'close']
} satisfies SetupComponentOptions<
@ -202,7 +206,12 @@ export const ListPage = defineComponent<
slots.default?.(selected.value)}
</container>
{props.close && (
<text text="关闭" cursor="pointer" font={props.font}></text>
<text
loc={props.closeLoc}
text="关闭"
cursor="pointer"
font={props.font}
></text>
)}
</container>
);

View File

@ -53,6 +53,7 @@ export const Statistics = defineComponent<StatisticsProps>(props => {
close
onClose={close}
lineHeight={24}
closeLoc={[10, 470, void 0, void 0, 0, 1]}
>
{{
total: () => <TotalStatistics data={props.data} />,