add tab bar

This commit is contained in:
2024-03-04 19:47:18 +08:00
parent 0713644961
commit 08fbd58c61
8 changed files with 103 additions and 6 deletions
+11
View File
@@ -1,7 +1,18 @@
import { View, Text } from '@tarojs/components';
import { Component, ReactNode } from 'react';
import Taro from '@tarojs/taro';
import type CustomTabBar from '../../custom-tab-bar';
import './user.scss';
export default class UserPage extends Component {
// 以下是TabBar相关
pageCtx = Taro.getCurrentInstance().page;
componentDidShow() {
const tabbar = Taro.getTabBar<CustomTabBar>(this.pageCtx);
tabbar?.setSelected(2);
}
// 以上是TabBar相关
render(): ReactNode {
return (
<View>