1.0.0 • Published 3 years ago

@heyuhang/hyh-pc v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

title: HYH

B端组件库

tested with jest language platform

预览地址

✨ 特性

  • 🌈 提炼自企业级中后台产品的交互语言和视觉风格。
  • 📦 基于 antd, 开箱即用的高质量 React 组件。
  • 🛡 使用 TypeScript 开发,提供完整的类型定义文件。

📦 安装

bnpm install @xxx

//或者:
npm install  @xxx --registry=https://registry.npm.taobao.org
yarn add  @xxx --registry=https://registry.npm.taobao.org

🚧 注意事项

- 依赖版本 -

组件库对 antd-mobile 的依赖版本请注意一下,如果使用了组件库并且没有多个 antd 版本共存的需求,那么你项目 package.json 中不需要有 antd 依赖,如果现在有的话请删除~

    "antd-mobile": "2.3.4"

🔨 使用示例

import { Button } from '@heyuhang/hyh-pc';

const App = () => (
  <>
    <Button type="primary">PRESS ME</Button>
  </>
);

- 样式引入 -

  • 全量引入
//引入全量css文件
import '@heyuhang/hyh-pc/dist/@heyuhang/hyh-pc.min.css';
//或者引入全量less文件
import '@heyuhang/hyh-pc/es/styles/index.less';

- 类型引入 -

import { SelectProps, OptionProps } from '@heyuhang/hyh-pc/es/components/select';
import { ColProps } from '@heyuhang/hyh-pc/es/components/col';

- 定制主题 -

参考 定制主题 文档。

- 国际化 -

import { LocaleProvider } from "@heyuhang/hyh-pc";
import zh_CN from "@heyuhang/hyh-pc/es/components/locale/zh_CN";
<LocaleProvider locale={zh_CN}>
  <Page />
</LocaleProvider>