- {typeof icon === 'string' ? (
-
- ) : (
- icon
- )}
+
+ {icon || defaultStatus[status]}
+
{typeof title === 'string' && title ? (
{title}
) : (
@@ -86,7 +77,9 @@ export const ResultPage: FunctionComponent<
const { text, ...rest } = action
return (
-
+
)
})}
diff --git a/src/packages/resultpage/types.ts b/src/packages/resultpage/types.ts
index 9f01264b7e..eb02bf4fc5 100644
--- a/src/packages/resultpage/types.ts
+++ b/src/packages/resultpage/types.ts
@@ -1,5 +1,5 @@
export type ResultPageStatusOptions = {
- [key: string]: string
+ [key: string]: React.ReactNode
}
export type ResultPageStatus =
diff --git a/src/styles/variables.scss b/src/styles/variables.scss
index 1995e15c8b..7d1e2bd082 100644
--- a/src/styles/variables.scss
+++ b/src/styles/variables.scss
@@ -2399,15 +2399,15 @@ $loading-color: var(--nutui-loading-color, $color-text-help) !default;
$loading-font-size: var(--nutui-loading-font-size, $font-size-s) !default;
// ResultPage
-$resultpage-width: var(--nutui-resultpage-width, 247px) !default;
-$resultpage-icon-size: var(--nutui-resultpage-icon-size, 48px) !default;
+$resultpage-width: var(--nutui-resultpage-width, 240px) !default;
+$resultpage-icon-size: var(--nutui-resultpage-icon-size, 36px) !default;
$resultpage-icon-margin-bottom: var(
--nutui-resultpage-icon-margin-bottom,
- 16px
+ 12px
) !default;
$resultpage-title-margin-bottom: var(
--nutui-resultpage-title-margin-bottom,
- 9px
+ 12px
) !default;
$resultpage-title-font-size: var(
--nutui-resultpage-title-font-size,
@@ -2431,5 +2431,5 @@ $resultpage-description-line-height: var(
) !default;
$resultpage-actions-margin-top: var(
--nutui-resultpage-actions-margin-top,
- 21px
+ 16px
) !default;
From 873a6352363b95d1959d100b959fa2683d33f2e4 Mon Sep 17 00:00:00 2001
From: songchenglin3 <353833373@qq.com>
Date: Tue, 12 Nov 2024 16:59:43 +0800
Subject: [PATCH 2/3] =?UTF-8?q?fix:=20harmony=E9=80=82=E9=85=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/packages/resultpage/resultpage.harmony.css | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/packages/resultpage/resultpage.harmony.css b/src/packages/resultpage/resultpage.harmony.css
index 82d69eb8cc..5e466a7831 100644
--- a/src/packages/resultpage/resultpage.harmony.css
+++ b/src/packages/resultpage/resultpage.harmony.css
@@ -6,21 +6,23 @@
margin: 0 auto;
}
.nut-resultpage-icon {
- height: 48px;
- width: 48px;
- margin-bottom: 16px;
- background-size: 100%;
+ display: inline-flex;
+ margin-bottom: 12px;
+}
+.nut-resultpage-icon .nut-icon {
+ height: 36px;
+ width: 36px;
}
.nut-resultpage-title {
- width: 247px;
- margin-bottom: 9px;
+ width: 240px;
+ margin-bottom: 12px;
font-size: 18px;
color: #1a1a1a;
font-weight: 600;
text-align: center;
}
.nut-resultpage-description {
- width: 247px;
+ width: 240px;
line-height: 20px;
font-size: 14px;
color: #505259;
@@ -33,7 +35,7 @@
.nut-resultpage-actions {
display: flex;
flex-direction: row;
- margin-top: 21px;
+ margin-top: 16px;
}
.nut-resultpage-action {
margin-left: 6px;
From 7fd671f6c20ec9fee65e8aadc5116d7981c38f7a Mon Sep 17 00:00:00 2001
From: songchenglin3 <353833373@qq.com>
Date: Thu, 14 Nov 2024 15:12:28 +0800
Subject: [PATCH 3/3] chore: update doc css variables
---
src/packages/resultpage/doc.en-US.md | 12 ++++++------
src/packages/resultpage/doc.md | 12 ++++++------
src/packages/resultpage/doc.taro.md | 12 ++++++------
src/packages/resultpage/doc.zh-TW.md | 12 ++++++------
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/packages/resultpage/doc.en-US.md b/src/packages/resultpage/doc.en-US.md
index 4a306fd216..4709a4d4b6 100644
--- a/src/packages/resultpage/doc.en-US.md
+++ b/src/packages/resultpage/doc.en-US.md
@@ -58,7 +58,7 @@ import { ResultPage } from '@nutui/nutui-react'
| Property | Description | Type | Default |
| --- | --- | --- | --- |
-| title | title | `ReactNode` | `-`|
+| title | title | `ReactNode` | `-` |
| description | Description, up to two lines displayed | `ReactNode` | `-` |
| status | Status type | `success` \| `error` \| `warning` \| `info` \| `waiting` | `info` |
| icon | Custom `icon` | `ReactNode` | `-` |
@@ -72,13 +72,13 @@ The component provides the following CSS variables, which can be used to customi
| Name | Description | Default |
| --- | --- | --- |
-| \--nutui-resultpage-width | Content area width | `247px` |
-| \--nutui-resultpage-icon-size | Width and height of icon | `48px` |
-| \--nutui-resultpage-icon-margin-bottom | margin-bottom value of the icon | `16px` |
-| \--resultpage-title-margin-bottom | The margin-top value of the title | `9px` |
+| \--nutui-resultpage-width | Content area width | `240px` |
+| \--nutui-resultpage-icon-size | Width and height of icon | `36px` |
+| \--nutui-resultpage-icon-margin-bottom | margin-bottom value of the icon | `12px` |
+| \--resultpage-title-margin-bottom | The margin-top value of the title | `12px` |
| \--nutui-resultpage-title-font-size | The font size of the title | `$font-size-xl` |
| \---nutui-resultpage-title-color | The text color of the title | `$color-title` |
| \--nutui-resultpage-description-font-size | Describe the font size | `$font-size-base` |
| \--nutui-resultpage-description-color | Describe the text color | `$color-text` |
| \--nutui-resultpage-description-line-height | Describe the line height | `20px` |
-| \--nutui-resultpage-actions-margin-topt | The margin-top value of the operation area | `21px` |
\ No newline at end of file
+| \--nutui-resultpage-actions-margin-topt | The margin-top value of the operation area | `16px` |
diff --git a/src/packages/resultpage/doc.md b/src/packages/resultpage/doc.md
index 51ae5b1989..71b174aab4 100644
--- a/src/packages/resultpage/doc.md
+++ b/src/packages/resultpage/doc.md
@@ -58,7 +58,7 @@ import { ResultPage } from '@nutui/nutui-react'
| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
-| title | 标题 | `ReactNode` | `-`|
+| title | 标题 | `ReactNode` | `-` |
| description | 描述,最多展示两行 | `ReactNode` | `-` |
| status | 状态类型 | `success` \| `error` \| `warning` \| `info` \| `waiting` | `info` |
| icon | 自定义 `icon` | `ReactNode` | `-` |
@@ -72,13 +72,13 @@ import { ResultPage } from '@nutui/nutui-react'
| 名称 | 说明 | 默认值 |
| --- | --- | --- |
-| \--nutui-resultpage-width | 内容区域宽度 | `247px` |
-| \--nutui-resultpage-icon-size | icon的宽高 | `48px` |
-| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `16px` |
-| \--resultpage-title-margin-bottom | 标题的margin-top值 | `9px` |
+| \--nutui-resultpage-width | 内容区域宽度 | `240px` |
+| \--nutui-resultpage-icon-size | icon的宽高 | `36px` |
+| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `12px` |
+| \--resultpage-title-margin-bottom | 标题的margin-top值 | `12px` |
| \--nutui-resultpage-title-font-size | 标题的字体大小 | `$font-size-xl` |
| \---nutui-resultpage-title-color | 标题的文字颜色 | `$color-title` |
| \--nutui-resultpage-description-font-size | 描述的字体大小 | `$font-size-base` |
| \--nutui-resultpage-description-color | 描述的文字颜色 | `$color-text` |
| \--nutui-resultpage-description-line-height | 描述的行高 | `20px` |
-| \--nutui-resultpage-actions-margin-topt | 操作区域的margin-top值 | `21px` |
\ No newline at end of file
+| \--nutui-resultpage-actions-margin-topt | 操作区域的margin-top值 | `16px` |
diff --git a/src/packages/resultpage/doc.taro.md b/src/packages/resultpage/doc.taro.md
index 8a12308b7f..9a520cadf9 100644
--- a/src/packages/resultpage/doc.taro.md
+++ b/src/packages/resultpage/doc.taro.md
@@ -58,7 +58,7 @@ import { ResultPage } from '@nutui/nutui-react-taro'
| 属性 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
-| title | 标题 | `ReactNode` | `-`|
+| title | 标题 | `ReactNode` | `-` |
| description | 描述,最多展示两行 | `ReactNode` | `-` |
| status | 状态类型 | `success` \| `error` \| `warning` \| `info` \| `waiting` | `info` |
| icon | 自定义 `icon` | `ReactNode` | `-` |
@@ -72,13 +72,13 @@ import { ResultPage } from '@nutui/nutui-react-taro'
| 名称 | 说明 | 默认值 |
| --- | --- | --- |
-| \--nutui-resultpage-width | 内容区域宽度 | `247px` |
-| \--nutui-resultpage-icon-size | icon的宽高 | `48px` |
-| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `16px` |
-| \--resultpage-title-margin-bottom | 标题的margin-top值 | `9px` |
+| \--nutui-resultpage-width | 内容区域宽度 | `240px` |
+| \--nutui-resultpage-icon-size | icon的宽高 | `36px` |
+| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `12px` |
+| \--resultpage-title-margin-bottom | 标题的margin-top值 | `12px` |
| \--nutui-resultpage-title-font-size | 标题的字体大小 | `$font-size-xl` |
| \---nutui-resultpage-title-color | 标题的文字颜色 | `$color-title` |
| \--nutui-resultpage-description-font-size | 描述的字体大小 | `$font-size-base` |
| \--nutui-resultpage-description-color | 描述的文字颜色 | `$color-text` |
| \--nutui-resultpage-description-line-height | 描述的行高 | `20px` |
-| \--nutui-resultpage-actions-margin-topt | 操作区域的margin-top值 | `21px` |
\ No newline at end of file
+| \--nutui-resultpage-actions-margin-topt | 操作区域的margin-top值 | `16px` |
diff --git a/src/packages/resultpage/doc.zh-TW.md b/src/packages/resultpage/doc.zh-TW.md
index 4986b19dba..f7e0c2c5b3 100644
--- a/src/packages/resultpage/doc.zh-TW.md
+++ b/src/packages/resultpage/doc.zh-TW.md
@@ -58,7 +58,7 @@ import { ResultPage } from '@nutui/nutui-react'
| 屬性 | 說明 | 類型 | 默認值 |
| --- | --- | --- | --- |
-| title | 標題 | `ReactNode` | `-`|
+| title | 標題 | `ReactNode` | `-` |
| description | 描述,最多展示兩行 | `ReactNode` | `-` |
| status | 狀態類型 | `success` \| `error` \| `warning` \| `info` \| `waiting` | `info` |
| icon | 自定義 `icon` | `ReactNode` | `-` |
@@ -72,13 +72,13 @@ import { ResultPage } from '@nutui/nutui-react'
| 名稱 | 說明 | 默認值 |
| --- | --- | --- |
-| \--nutui-resultpage-width | 內容區域寬度 | `247px` |
-| \--nutui-resultpage-icon-size | icon的寬高 | `48px` |
-| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `16px` |
-| \--resultpage-title-margin-bottom | 標題的margin-top值 | `9px` |
+| \--nutui-resultpage-width | 內容區域寬度 | `240px` |
+| \--nutui-resultpage-icon-size | icon的寬高 | `36x` |
+| \--nutui-resultpage-icon-margin-bottom | icon的margin-bottom值 | `12px` |
+| \--resultpage-title-margin-bottom | 標題的margin-top值 | `12px` |
| \--nutui-resultpage-title-font-size | 標題的字體大小 | `$font-size-xl` |
| \---nutui-resultpage-title-color | 標題的文字顏色 | `$color-title` |
| \--nutui-resultpage-description-font-size | 描述的字體大小 | `$font-size-base` |
| \--nutui-resultpage-description-color | 描述的文字顏色 | `$color-text` |
| \--nutui-resultpage-description-line-height | 描述的行高 | `20px` |
-| \--nutui-resultpage-actions-margin-topt | 操作區域的margin-top值 | `21px` |
\ No newline at end of file
+| \--nutui-resultpage-actions-margin-topt | 操作區域的margin-top值 | `16px` |