File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const defaultProps = {
2020export const Price : FunctionComponent < Partial < TaroPriceProps > > = ( props ) => {
2121 const {
2222 color,
23- price,
23+ price : originalPrice ,
2424 symbol,
2525 digits,
2626 thousands,
@@ -38,6 +38,10 @@ export const Price: FunctionComponent<Partial<TaroPriceProps>> = (props) => {
3838
3939 const rtl = useRtl ( )
4040
41+ const price = useMemo ( ( ) => {
42+ return originalPrice . toString ( ) . replace ( / [ ^ \d . ] / g, '' )
43+ } , [ originalPrice ] )
44+
4145 const isCustomPriceColor = useMemo ( ( ) => {
4246 const specificPriceColor = Object . values ( PriceColorEnum )
4347 return ! specificPriceColor . includes ( color as PriceColorEnum )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const defaultProps = {
1818export const Price : FunctionComponent < Partial < WebPriceProps > > = ( props ) => {
1919 const {
2020 color,
21- price,
21+ price : originalPrice ,
2222 symbol,
2323 digits,
2424 thousands,
@@ -37,6 +37,10 @@ export const Price: FunctionComponent<Partial<WebPriceProps>> = (props) => {
3737
3838 const rtl = useRtl ( )
3939
40+ const price = useMemo ( ( ) => {
41+ return originalPrice . toString ( ) . replace ( / [ ^ \d . ] / g, '' )
42+ } , [ originalPrice ] )
43+
4044 const isCustomPriceColor = useMemo ( ( ) => {
4145 const specificPriceColor = Object . values ( PriceColorEnum )
4246 return ! specificPriceColor . includes ( color as PriceColorEnum )
You can’t perform that action at this time.
0 commit comments