Skip to content

Commit 58b3240

Browse files
committed
fix: 修订demo
1 parent 76e8f49 commit 58b3240

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

src/packages/hoverbutton/demo.taro.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Demo3 from './demos/taro/demo3'
1010
import Demo4 from './demos/taro/demo4'
1111
import Demo6 from './demos/taro/demo6'
1212
import { harmonyAndRn } from '@/utils/platform-taro'
13-
// import Demo5 from './demos/taro/demo5'
13+
import Demo5 from './demos/taro/demo5'
1414

1515
const isNative = harmonyAndRn()
1616

@@ -28,7 +28,7 @@ const HoverDemo = () => {
2828
'zh-TW': {
2929
show: '展示',
3030
basic: '基礎用法',
31-
customNode: '按鈕和文字',
31+
customNode: '自定义内容',
3232
multiButtons: '多個按鈕',
3333
hasTabbar: '有底部導航欄的情況',
3434
customZIndex: '自定義層級',
@@ -37,7 +37,7 @@ const HoverDemo = () => {
3737
'en-US': {
3838
show: 'Show ',
3939
basic: 'Basic Usage',
40-
customNode: 'Icon And Text',
40+
customNode: 'Custom Node',
4141
multiButtons: 'Multiple Buttons',
4242
hasTabbar: 'With Tabbar',
4343
customZIndex: 'Custom Z-Index',
@@ -86,15 +86,13 @@ const HoverDemo = () => {
8686
/>
8787

8888
{/* @TODO RN、鸿蒙端暂不支持 ConfigProvider */}
89-
{/* {!isNative && <View className="h2">{translated.customSpacing}</View>}
90-
{!isNative && (
91-
<Cell
92-
title={`${translated.show}${translated.customSpacing}`}
93-
onClick={() => {
94-
setCurDemo('customSpacing')
95-
}}
96-
/>
97-
)} */}
89+
<View className="h2">{translated.customSpacing}</View>
90+
<Cell
91+
title={`${translated.show}${translated.customSpacing}`}
92+
onClick={() => {
93+
setCurDemo('customSpacing')
94+
}}
95+
/>
9896

9997
<View className="h2">{translated.customNode}</View>
10098
<Cell
@@ -110,7 +108,7 @@ const HoverDemo = () => {
110108
{curDemo === 'multiButtons' && <Demo2 />}
111109
{curDemo === 'hasTabbar' && <Demo3 />}
112110
{curDemo === 'customZIndex' && <Demo4 />}
113-
{/* {curDemo === 'customSpacing' && <Demo5 />} */}
111+
{curDemo === 'customSpacing' && <Demo5 />}
114112
</View>
115113
)
116114
}

src/packages/hoverbutton/demo.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const HoverButtonDemo = () => {
1313
'zh-CN': {
1414
show: '展示',
1515
basic: '基础用法',
16-
customNode: '按钮和文字',
16+
customNode: '自定义内容',
1717
multiButtons: '多个按钮',
1818
hasTabbar: '有底部导航栏的情况',
1919
customZIndex: '自定义层级',
@@ -87,16 +87,15 @@ const HoverButtonDemo = () => {
8787
}}
8888
/>
8989
{curDemo === 'customSpacing' && <Demo5 />}
90+
<h2>{translated.customNode}</h2>
91+
<Cell
92+
title={`${translated.show}${translated.customNode}`}
93+
onClick={() => {
94+
setCurDemo('customNode')
95+
}}
96+
/>
97+
{curDemo === 'customNode' && <Demo6 />}
9098
</div>
91-
92-
<h2>{translated.customNode}</h2>
93-
<Cell
94-
title={`${translated.show}${translated.customNode}`}
95-
onClick={() => {
96-
setCurDemo('customNode')
97-
}}
98-
/>
99-
{curDemo === 'customNode' && <Demo6 />}
10099
</>
101100
)
102101
}

src/packages/hoverbutton/demos/h5/demo2.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const Demo2 = () => {
2929
<HoverButton>
3030
<HoverButton.Item icon={<Cart />} onClick={testClick1} />
3131
<HoverButton.Item icon={<Cart />} onClick={testClick2} />
32-
<HoverButton.Item icon={<Cart />} onClick={testClick3} />
3332
<HoverButton.Item icon={<Cart />} onClick={testClick3}>
3433
购物
3534
</HoverButton.Item>

src/packages/hoverbutton/demos/taro/demo2.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const Demo2 = () => {
2020
<HoverButton>
2121
<HoverButton.Item icon={<Cart />} onClick={testClick1} />
2222
<HoverButton.Item icon={<Cart />} onClick={testClick2} />
23-
<HoverButton.Item icon={<Cart />} onClick={testClick3} />
2423
<HoverButton.Item icon={<Cart />} onClick={testClick3}>
2524
购物
2625
</HoverButton.Item>

0 commit comments

Comments
 (0)