--- outline: deep --- # Timer API Examples 本页是介绍`@pear-rec/timer` 插件的`API`例子 本插件提供了计时器功能。 ## 安装 ```js import "@pear-rec/timer"; import "@pear-rec/timer/src/Timer/index.module.scss"; ``` ## timer 计时器 ### 效果展示
### 完整代码 ```js import { useState } from "react"; import { useStopwatch } from "react-timer-hook"; import Timer from "@pear-rec/timer"; import "@pear-rec/timer/src/Timer/index.module.scss"; function App() { const { seconds, minutes, hours, days, start, pause, reset } = useStopwatch({ autoStart: true, }); const [isShowTitle] = useState(true); return (