/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/mini-program-example/src/pages/api/basics/miniProgram/index.tsx
51 строка
1 KB
刘阳
同步harmony最新开发分支的代码:例子程序
02 апр 2024, 09:33
02 апр 2024, 09:33
d958330
Код
Авторство
О чём код?
import React from 'react' import Taro from '@tarojs/taro' import { View, Text } from '@tarojs/components' import LifeCycle from './lifeCycle/index' import ApplicationLevelEvents from './applicationLevelEvents/index' import ButtonList from '@/components/buttonList' import './index.scss' /** * 基础-小程序 * @returns */ export default class Index extends React.Component { state = { list: [ { id: 'lifeCycle', func: (apiIndex) => { this.setState({ showAPI: 'lifeCycle', }) }, }, { id: 'applicationLevelEvents', func: (apiIndex) => { this.setState({ showAPI: 'applicationLevelEvents', }) }, }, ], showAPI: '', } render() { const { list } = this.state return ( <View className='api-page'> <ButtonList buttonList={list} /> {this.state.showAPI == 'lifeCycle' ? ( <LifeCycle /> ) : this.state.showAPI == 'applicationLevelEvents' ? ( <ApplicationLevelEvents /> ) : ( '' )} </View> ) } }