/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/mini-program-example/src/pages/api/device/memory/index.tsx
43 строки
967 B
刘阳
同步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 ButtonList from '@/components/buttonList' import './index.scss' import { TestConsole } from '@/util/util' /** * 设备-内存 * @returns */ export default class Index extends React.Component { state = { list: [ { id: 'onMemoryWarning', func: (apiIndex) => { Taro.onMemoryWarning(function () { console.log('success on memory warning.') console.log('memory is run out.') }) }, }, { id: 'offMemoryWarning', func: (apiIndex) => { Taro.offMemoryWarning(function (res) { TestConsole.consoleNormal('offMemoryWarning', res) }) }, }, ], } render() { const { list } = this.state return ( <View className='api-page'> <ButtonList buttonList={list} /> </View> ) } }