@@ -82,19 +82,35 @@ import { Price } from '@nutui/nutui-react'
8282
8383:::
8484
85+ ### Custom color
86+
87+ ::: demo
88+
89+ <CodeBlock src =' h5/demo10.tsx ' ></CodeBlock >
90+
91+ :::
92+
93+ ### Data original output
94+
95+ ::: demo
96+
97+ <CodeBlock src =' h5/demo11.tsx ' ></CodeBlock >
98+
99+ :::
100+
85101## Price
86102
87103### Props
88104
89105| Property | Description | Type | Default |
90106| --- | --- | --- | --- |
91- | color | Price type | ` primary ` \| ` gray ` \| ` darkgray ` | ` primary ` |
107+ | color | Price type, supports custom colors | ` primary ` \| ` gray ` \| ` darkgray ` \| ` string ` | ` primary ` |
92108| price | Price | ` number ` | ` 0 ` |
93109| symbol | Symbol type | ` string ` | ` ¥ ` |
94- | digits | Decimal digits | ` number ` | ` 2 ` |
110+ | digits | Decimal digits, pass ` null ` for original data output | ` number ` \| ` null ` | ` 2 ` |
95111| thousands | Thousands separation | ` boolean ` | ` false ` |
96112| position | The symbol appear before or after the price,` before ` 、` after ` | ` string ` | ` before ` |
97- | size | Size,` xlarge ` \| ` large ` \| ` normal ` \| ` small ` | ` string ` | ` large ` |
113+ | size | Size,` xlarge ` \| ` large ` \| ` normal ` \| ` small ` | ` string ` | ` normal ` |
98114| line | Line-through price | ` boolean ` | ` false ` |
99115
100116## Theming
@@ -105,9 +121,9 @@ The component provides the following CSS variables, which can be used to customi
105121
106122| Name | Description | Default |
107123| --- | --- | --- |
108- | \- -nutui-price-primary-color | Text color when type is primary | ` #ff0f23 ` |
109- | \- -nutui-price-color | Text color when type is gray | ` #888b94 ` |
110- | \- -nutui-price-darkgray-color | Text color when type is darkgray | ` #1a1a1a ` |
124+ | \- -nutui-price-primary-color | Text color when color is primary | ` #ff0f23 ` |
125+ | \- -nutui-price-color | Text color when color is gray | ` #888b94 ` |
126+ | \- -nutui-price-darkgray-color | Text color when color is darkgray | ` #1a1a1a ` |
111127| \- -nutui-price-line-color | Underline price color | ` #888b94 ` |
112128| \- -nutui-price-symbol-padding-right | Right padding of symbol | ` 0px ` |
113129| \- -nutui-price-symbol-xlarge-size | xlarge size symbol font size | ` 12px ` |
0 commit comments