11import React from 'react'
22import { Button , Cell } from '@nutui/nutui-react-taro'
33import { Plus , Star } from '@nutui/icons-react-taro'
4- import pxTransform from '@/utils/px-transform '
4+ import { harmony } from '@/utils/platform-taro '
55
66const Demo4 = ( ) => {
77 const marginStyle = {
8- marginRight : pxTransform ( 8 ) ,
9- marginTop : pxTransform ( 8 ) ,
10- marginLeft : pxTransform ( 8 ) ,
11- marginBottom : pxTransform ( 8 ) ,
8+ width : harmony ( ) ? 140 : 'auto' ,
9+ margin : 8 ,
1210 }
1311 return (
1412 < >
@@ -44,6 +42,7 @@ const Demo4 = () => {
4442 rightIcon = { < Star /> }
4543 style = { {
4644 margin : 8 ,
45+ width : harmony ( ) ? 140 : 'auto' ,
4746 backgroundColor : `var(--nutui-color-primary-light-pressed)` ,
4847 borderColor : `var(--nutui-color-primary)` ,
4948 color : `var(--nutui-color-primary)` ,
@@ -58,6 +57,7 @@ const Demo4 = () => {
5857 rightIcon = { < Star /> }
5958 style = { {
6059 margin : 8 ,
60+ width : harmony ( ) ? 140 : 'auto' ,
6161 backgroundColor : `var(--nutui-gray-3)` ,
6262 color : `var(--nutui-gray-7)` ,
6363 } }
@@ -71,6 +71,7 @@ const Demo4 = () => {
7171 rightIcon = { < Star /> }
7272 style = { {
7373 margin : 8 ,
74+ width : harmony ( ) ? 140 : 'auto' ,
7475 backgroundColor : `var(--nutui-gray-1)` ,
7576 color : `var(--nutui-gray-7)` ,
7677 } }
@@ -81,30 +82,34 @@ const Demo4 = () => {
8182 type = "default"
8283 icon = { < Star /> }
8384 rightIcon = { < Star /> }
84- style = { {
85- margin : 8 ,
86- } }
85+ style = { marginStyle }
8786 >
8887 Button
8988 </ Button >
9089 < Button
9190 shape = "square"
9291 fill = "outline"
9392 type = "primary"
94- icon = { < Plus /> }
95- style = { marginStyle }
93+ icon = { < Plus size = { 10 } /> }
94+ style = { {
95+ margin : 8 ,
96+ } }
9697 />
9798 < Button
9899 fill = "outline"
99100 type = "primary"
100- icon = { < Plus /> }
101- style = { marginStyle }
101+ icon = { < Plus size = { 10 } /> }
102+ style = { {
103+ margin : 8 ,
104+ } }
102105 />
103106 < Button
104107 type = "primary"
105108 fill = "dashed"
106- icon = { < Plus /> }
107- style = { marginStyle }
109+ icon = { < Plus size = { 10 } /> }
110+ style = { {
111+ margin : 8 ,
112+ } }
108113 />
109114 < Button
110115 shape = "round"
0 commit comments