-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: all nav coms have been replaced
- Loading branch information
1 parent
c6abb10
commit 92071a4
Showing
21 changed files
with
303 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
import React, { useState } from 'react' | ||
import { FixedNav } from '@nutui/nutui-react' | ||
import { withTranslation, propsType } from '@/translation/demo.translation' | ||
|
||
const Demo2 = () => { | ||
const Demo2 = ({ t }: propsType) => { | ||
const list = [ | ||
{ | ||
id: 1, | ||
text: '首页', | ||
text: t.home, | ||
icon: 'https://img11.360buyimg.com/imagetools/jfs/t1/117646/2/11112/1297/5ef83e95E81d77f05/daf8e3b1c81e3c98.png', | ||
}, | ||
{ | ||
id: 2, | ||
text: '分类', | ||
text: t.category, | ||
icon: 'https://img12.360buyimg.com/imagetools/jfs/t1/119490/8/9568/1798/5ef83e95E968c69a6/dd029326f7d5042e.png', | ||
}, | ||
{ | ||
id: 3, | ||
text: '购物车', | ||
text: t.cart, | ||
num: 2, | ||
icon: 'https://img14.360buyimg.com/imagetools/jfs/t1/130725/4/3157/1704/5ef83e95Eb976644f/b36c6cfc1cc1a99d.png', | ||
}, | ||
{ | ||
id: 4, | ||
text: '我的', | ||
text: t.mine, | ||
icon: 'https://img12.360buyimg.com/imagetools/jfs/t1/147573/29/1603/1721/5ef83e94E1393a678/5ddf1695ec989373.png', | ||
}, | ||
] | ||
|
||
const [visible, setVisible] = useState(false) | ||
|
||
const change = (value: boolean) => { | ||
setVisible(value) | ||
} | ||
|
||
const selected = ( | ||
item: any, | ||
event: React.MouseEvent<Element, MouseEvent> | ||
) => { | ||
console.log(item, event) | ||
} | ||
|
||
return ( | ||
<> | ||
<FixedNav | ||
list={list} | ||
type="left" | ||
position={{ top: '140px' }} | ||
visible={visible} | ||
activeText="左侧收起" | ||
inactiveText="左侧展开" | ||
activeText={t.collapseLeft} | ||
inactiveText={t.expandLeft} | ||
onChange={change} | ||
onSelect={selected} | ||
/> | ||
</> | ||
) | ||
} | ||
export default Demo2 | ||
|
||
export default withTranslation(Demo2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.