computer-count
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

初始化

使用npm

# npm 版本 < 7
npm i -g npm
# 安装依赖
npm install computer-count -S

如何使用

import ComputerCount from 'computer-count';
import { useEffect, useState } from 'react';
function App() {
  const [num, setNum] = useState<number[]>([1, 2, 3]);
  useEffect(() => {
    setInterval(() => {
      const one = parseInt(String(Math.random() * 10));
      const two = parseInt(String(Math.random() * 10));
      const three = parseInt(String(Math.random() * 10));
      setNum([one, two, three]);
    }, 1000);
  }, []);
  return (
    <div>
      <ComputerCount num={num} />
    </div>
  );
}

export default App;

属性名

  • num: 数组例如:[1, 2, 3] 或 ['1', '2', '3']
  • style: 样式style
  • className: 文字class

效果预览

Readme

Keywords

Package Sidebar

Install

npm i computer-count

Weekly Downloads

0

Version

0.0.6

License

none

Unpacked Size

276 kB

Total Files

8

Last publish

Collaborators

  • liucheng1992