feat: 我的页面
This commit is contained in:
33
src/pages/components/TabbarCom/index.tsx
Normal file
33
src/pages/components/TabbarCom/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Tabbar, TabbarItem } from "@antmjs/vantui";
|
||||
import { View } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import react from "react";
|
||||
|
||||
const TabbarCom = (props: any) => {
|
||||
const [active, setActive] = react.useState(props?.active ?? 0);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Tabbar
|
||||
active={active}
|
||||
onChange={(e: any) => {
|
||||
console.log("e", e);
|
||||
setActive(e?.detail);
|
||||
if(e?.detail===2){
|
||||
Taro.navigateTo({
|
||||
url: "/pages/my/index",
|
||||
});
|
||||
}
|
||||
}}
|
||||
safeAreaInsetBottom={false}
|
||||
>
|
||||
<TabbarItem icon="home-o">首页</TabbarItem>
|
||||
{/* <TabbarItem icon="search">标签</TabbarItem> */}
|
||||
<TabbarItem icon="friends-o">活动</TabbarItem>
|
||||
<TabbarItem icon="setting-o">我的</TabbarItem>
|
||||
</Tabbar>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default TabbarCom;
|
||||
Reference in New Issue
Block a user