发布页开发
This commit is contained in:
25
src/app.ts
25
src/app.ts
@@ -1,19 +1,22 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { useDidShow, useDidHide } from '@tarojs/taro'
|
||||
// 全局样式
|
||||
import { Component, ReactNode } from 'react'
|
||||
import './app.scss'
|
||||
import './nutui-theme.scss'
|
||||
|
||||
function App(props: any) {
|
||||
// 可以使用所有的 React Hooks
|
||||
useEffect(() => {})
|
||||
interface AppProps {
|
||||
children: ReactNode
|
||||
}
|
||||
|
||||
// 对应 onShow
|
||||
useDidShow(() => {})
|
||||
class App extends Component<AppProps> {
|
||||
componentDidMount() {}
|
||||
|
||||
// 对应 onHide
|
||||
useDidHide(() => {})
|
||||
componentDidShow() {}
|
||||
|
||||
return props.children
|
||||
componentDidHide() {}
|
||||
|
||||
render() {
|
||||
// this.props.children 是将要会渲染的页面
|
||||
return this.props.children
|
||||
}
|
||||
}
|
||||
|
||||
export default App
|
||||
|
||||
Reference in New Issue
Block a user