我在以下方面有点困难:-我有两个组件,Album.js和PlayerBar.js -我在Album.js中定义了一个方法formatTime(),并希望将其传递给PlayerBar。目的:在PlayerBar中,我想调用formatTime()方法将持续时间从ss转换为hh.mm.ss。..。Album.js (父组件) (full code) class Album extends Component { s
我想在另一个组件中从秒表中同时显示formatTime,以便当我从输入中保存值时,秒表中的当前时间将保存并显示在列表上?有人能帮我吗?我是新手吗?问题是,我不知道如何获得formatTime的值,就像在返回的Kello.js中那样,只调用它,因为它在一个不同的组件中。Kello.js const [timer,setTimerdefault Ke