基于Taro.js开发的H5应用
This commit is contained in:
25
src/app.ts
Normal file
25
src/app.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import {useEffect} from 'react'
|
||||
import Taro from '@tarojs/taro'
|
||||
import {useDidShow, useDidHide} from '@tarojs/taro'
|
||||
|
||||
// 全局样式
|
||||
import './app.scss'
|
||||
|
||||
function App(props) {
|
||||
// 可以使用所有的 React Hooks
|
||||
useEffect(() => {
|
||||
}, []);
|
||||
|
||||
// 对应 onShow
|
||||
useDidShow(() => {
|
||||
Taro.hideTabBar()
|
||||
})
|
||||
|
||||
// 对应 onHide
|
||||
useDidHide(() => {
|
||||
})
|
||||
|
||||
return props.children
|
||||
}
|
||||
|
||||
export default App
|
||||
Reference in New Issue
Block a user