Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud committed Dec 27, 2024
1 parent a5818bc commit e925231
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 131 deletions.
8 changes: 2 additions & 6 deletions migrate-from-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,8 @@ plugins: [

#### Indicator

- 移除 `block`,暴露自定义节点
- 移除 `align`,暴露自定义节点
- `vertical` 重命名为`direction`,默认值为 `horizontal`,可选 `vertical`
- 移除 `fillZero`,暴露自定义节点
- `size` 重命名为 `total`
- 增加非数字展示,并设置为默认状态
- type 属性的值调整为 `'anchor'``'slide'`
- color 属性的值增加 `'white'`

#### Menu

Expand Down
2 changes: 1 addition & 1 deletion src/packages/indicator/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Demo1 = () => {
<Cell>
<Indicator total={2} current={0} direction="vertical" />
</Cell>
<Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator total={2} current={1} direction="vertical" color="white" />
</Cell>
</>
Expand Down
96 changes: 50 additions & 46 deletions src/packages/indicator/demos/h5/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,59 @@ import { Cell, Indicator } from '@nutui/nutui-react'

const Demo4 = () => {
return (
<Cell>
<Indicator total={6} current={5} direction="vertical">
<div
<>
<Cell>
<Indicator total={6} current={5} direction="vertical">
<div
style={{
display: 'inline-block',
width: '14px',
height: '14px',
lineHeight: '14px',
textAlign: 'center',
fontSize: '12px',
color: '#FFFFFF',
border: '1px solid #FFFFFF',
borderRadius: '50%',
margin: '4px',
background: `var(--nutui-color-primary)`,
boxShadow: `0 0 1px 1px var(--nutui-color-primary)`,
}}
>
{5}
</div>
</Indicator>
<Indicator
total={6}
current={2}
direction="vertical"
style={{
display: 'inline-block',
width: '14px',
height: '14px',
lineHeight: '14px',
textAlign: 'center',
fontSize: '12px',
color: '#FFFFFF',
border: '1px solid #FFFFFF',
borderRadius: '50%',
margin: '4px',
background: `var(--nutui-color-primary)`,
boxShadow: `0 0 1px 1px var(--nutui-color-primary)`,
marginLeft: '50px',
}}
>
{5}
</div>
</Indicator>
<Indicator
total={6}
current={2}
direction="vertical"
style={{
marginLeft: '50px',
}}
/>
<Indicator
total={6}
current={2}
direction="vertical"
color="white"
style={{
marginLeft: '50px',
}}
/>
/>

<Indicator
total={6}
current={5}
direction="vertical"
type="slide"
style={{
marginLeft: '50px',
}}
/>
</Cell>
<Indicator
total={6}
current={5}
direction="vertical"
type="slide"
style={{
marginLeft: '50px',
}}
/>
</Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator
total={6}
current={2}
direction="vertical"
color="white"
style={{
marginLeft: '50px',
}}
/>
</Cell>
</>
)
}
export default Demo4
2 changes: 1 addition & 1 deletion src/packages/indicator/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Cell, Indicator } from '@nutui/nutui-react'
const Demo5 = () => {
return (
<>
<Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator total={3} current={0} color="white" />
</Cell>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/indicator/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Demo1 = () => {
<Cell>
<Indicator total={2} current={0} direction="vertical" />
</Cell>
<Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator total={2} current={1} direction="vertical" color="white" />
</Cell>
</>
Expand Down
152 changes: 78 additions & 74 deletions src/packages/indicator/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,85 +1,89 @@
import React from 'react'
import { Indicator, Cell } from '@nutui/nutui-react-taro'
import { Cell, Indicator } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
import { harmonyAndRn } from '@/utils/platform-taro'
import pxTransform from '@/utils/px-transform'

const Demo4 = () => {
return (
<Cell>
<Indicator total={6} current={5} direction="vertical">
<View
style={
!harmonyAndRn()
? {
display: 'inline-block',
width: '14px',
height: '14px',
lineHeight: '14px',
textAlign: 'center',
fontSize: '12px',
color: '#FFFFFF',
border: '1px solid #FFFFFF',
borderRadius: '50%',
margin: '4px',
backgroundColor: 'var(--nutui-color-primary)',
boxShadow: `0 0 1px 1px var(--nutui-color-primary)`,
}
: {
display: 'inline-block',
width: pxTransform(14),
height: pxTransform(14),
lineHeight: pxTransform(14),
textAlign: 'center',
fontSize: pxTransform(12),
color: '#FFFFFF',
borderWidth: 1,
borderColor: '#FFFFFF',
borderRadius: pxTransform(14),
margin: 4,
backgroundColor: '#ff0f23',
// @ts-ignore
shadowColor: '#ff0f23',
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 1,
shadowRadius: 1,
}
}
>
{5}
</View>
</Indicator>
<Indicator
total={6}
current={2}
direction="vertical"
style={{
marginLeft: 50,
}}
/>
<Indicator
total={6}
current={2}
direction="vertical"
color="white"
style={{
marginLeft: '50px',
}}
/>
<>
<Cell>
<Indicator total={6} current={5} direction="vertical">
<View
style={
!harmonyAndRn()
? {
display: 'inline-block',
width: '14px',
height: '14px',
lineHeight: '14px',
textAlign: 'center',
fontSize: '12px',
color: '#FFFFFF',
border: '1px solid #FFFFFF',
borderRadius: '50%',
margin: '4px',
backgroundColor: 'var(--nutui-color-primary)',
boxShadow: `0 0 1px 1px var(--nutui-color-primary)`,
}
: {
display: 'inline-block',
width: pxTransform(14),
height: pxTransform(14),
lineHeight: pxTransform(14),
textAlign: 'center',
fontSize: pxTransform(12),
color: '#FFFFFF',
borderWidth: 1,
borderColor: '#FFFFFF',
borderRadius: pxTransform(14),
margin: 4,
backgroundColor: '#ff0f23',
// @ts-ignore
shadowColor: '#ff0f23',
shadowOffset: {
width: 0,
height: 0,
},
shadowOpacity: 1,
shadowRadius: 1,
}
}
>
{5}
</View>
</Indicator>
<Indicator
total={6}
current={2}
direction="vertical"
style={{
marginLeft: 50,
}}
/>

<Indicator
total={6}
current={5}
direction="vertical"
type="slide"
style={{
marginLeft: '50px',
}}
/>
</Cell>
<Indicator
total={6}
current={5}
direction="vertical"
type="slide"
style={{
marginLeft: '50px',
}}
/>
</Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator
total={6}
current={2}
direction="vertical"
color="white"
style={{
marginLeft: '50px',
}}
/>
</Cell>
</>
)
}
export default Demo4
2 changes: 1 addition & 1 deletion src/packages/indicator/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Cell, Indicator } from '@nutui/nutui-react-taro'
const Demo5 = () => {
return (
<>
<Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator total={3} current={0} color="white" />
</Cell>
</>
Expand Down
7 changes: 6 additions & 1 deletion src/packages/indicator/indicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
//justify-content: center;

&-fixed-width {
width: 21px;
Expand Down Expand Up @@ -116,6 +115,12 @@

&-active {
opacity: 1;
background: rgba(255, 255, 255, 1);
}
}
&-dot {
&-active {
background: rgba(255, 255, 255, 1);
}
}
}
Expand Down

0 comments on commit e925231

Please sign in to comment.