ant-design-mobile icon indicating copy to clipboard operation
ant-design-mobile copied to clipboard

[RFC] ResultPage 结果页面

Open p697 opened this issue 2 years ago • 1 comments

Version of antd-mobile

latest

What is this feature about?

属性

interface ResultPageDetail {
  label: ReactNode;
  value: ReactNode;
  major: boolean;
}

type ResultPageDetails = ResultPageDetail[]

其中 major 字段为 true 时,文字会加粗。为 falseundefined 时,不加粗。

属性 说明 类型 默认值
status 状态类型 'success' | 'error' | 'info' | 'waiting' | 'warning' 'info'
icon 自定义 icon ReactNode -
title 标题 ReactNode -
description 描述 ReactNode -
details 详细信息,超过三条自动折叠 ResultPageDetail[] -
children 内容,只支持传入Card组件 Card -
primaryButtonValue 主要操作按钮的文字,为undefinednull或空字符时不显示按钮 ReactNode -
onPrimaryButtonClick 点击主要操作按钮后的事件 (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> -
secondaryButtonValue 辅助操作按钮的文字,为undefinednull或空字符时不显示按钮 ReactNode -
onSecondaryButtonClick 点击辅助操作按钮后的事件 (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void |Promise<void> -

CSS 变量

属性 说明 默认值
--background-color 背景颜色 var(--adm-color-primary)
--description-color 描述文字的颜色 #84b9ff

注:设置 --description-color 是因为用户在改变 --background-color 后,应该会有改变描述文字颜色的需求。 描述文字的颜色方案本来可以通过 opacity 来实现,但是因为描述这个位置有自定义的需求,所以不能使用 opacity。故目前可能只能写死一个颜色,然后让用户通过 CSS 变量去自定义。

p697 avatar Jul 14 '22 11:07 p697

content -> children

awmleer avatar Jul 15 '22 01:07 awmleer