12345678910111213141516171819202122232425 |
- import { useMemo } from 'react'
- import type CustomTabBar from '../../custom-tab-bar'
- import { View, Text } from '@tarojs/components'
- import Taro, { useLoad, useDidShow } from '@tarojs/taro'
- import './home.less'
- export default function Index() {
- const page = useMemo(() => Taro.getCurrentInstance().page, [])
- useLoad(() => {
- console.log('Page loaded.')
- })
- useDidShow(() =>{
- const tabbar = Taro.getTabBar<CustomTabBar>(page)
- tabbar?.setSelected(1)
- })
- return (
- <View className='index'>
- <Text>Hello world!</Text>
- </View>
- )
- }
|