Skip to content

Commit

Permalink
docs: 细化项目介绍
Browse files Browse the repository at this point in the history
增加测试CI Badge
增加单测覆盖率 Badge
增加与其它类库的对比
  • Loading branch information
xyy94813 committed Oct 10, 2023
1 parent 330dbf4 commit 830bb75
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@
[![package version](https://img.shields.io/npm/v/amap-react-components.svg?style=flat-square)](https://www.npmjs.org/package/amap-react-components)
[![npm downloads](https://img.shields.io/npm/dm/amap-react-components.svg?style=flat-square)](http://npmjs.com/amap-react-components)

[![Codecov](https://github.com/xyy94813/amap-react-components/actions/workflows/codecov.yml/badge.svg?branch=main)](https://github.com/xyy94813/amap-react-components/actions/workflows/codecov.yml)
[![codecov](https://codecov.io/gh/xyy94813/amap-react-components/branch/main/graph/badge.svg?token=DCC845JGZW)](https://codecov.io/gh/xyy94813/amap-react-components)

[AMap](https://lbs.amap.com/api/jsapi-v2/summary/) 的 React 组件。

> 注意: 仅支持 AMap V2 且 React >= 16.8.
## Difference with react-amap
## 对比其他库

| | amap-react-components | @amap/amap-react | react-amap |
| ---------------- | --------------------- | ------------------ | ------------------ |
| 官方 | :x: | :white_check_mark: | :x: (饿了么团队) |
| 开源 | :white_check_mark: | :x: | :x: |
| 活跃度 | 较高 |||
| 使用文档 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 单元测试覆盖率 || :question: | :x: |
| 基于 React Hooks | :white_check_mark: | :question: | :x: |
| 支持 amap v2 | :white_check_mark: | :white_check_mark: | :x: |
| 支持 amap ui | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 支持 TS | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| 支持 Vite | :white_check_mark: | :question: | :question: |
| 自定义组件 | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| UMD 模块 | :white_check_mark: | :question: | :white_check_mark: |

- **更加活跃!!!**
- 支持 amap v2
- 基于 react hook
- 开源
- [@amap/amap-react](https://www.npmjs.com/package/@amap/amap-react) (高德官方 react 组件 )
- [react-amap](https://github.com/elemefe/react-amap)

## 使用

Expand All @@ -25,6 +41,16 @@ yarn add amap-react-components
// npm i amap-react-components
```

### Browser

提供 browser 后缀支持 UMD 模块

例如:

```
https://cdn.jsdelivr.net/npm/amap-react-components@0.0.1/dist/amap-react-components.browser.js
```

### 示例及 API

[各组件示例](https://xyy94813.github.io/amap-react-components)
Expand All @@ -46,28 +72,13 @@ npm install @amap/amap-jsapi-types
> 如过,有人知道如何将这部分声明文件在构建时一同打包进最终的输出中,麻烦告知我。
> 如果能看到您的 PR 那就更好了。
### Browser

提供 browser 后缀支持 UMD 模块

例如:

```
https://cdn.jsdelivr.net/npm/amap-react-components@0.0.1/dist/amap-react-components.browser.js
```

### Polyfill

使用者可能需要自行处理以下兼容性

- [Proxy](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
--> [Proxy Polyfill](https://github.com/GoogleChrome/proxy-polyfill)

## 其它

- [@amap/amap-react](https://www.npmjs.com/package/@amap/amap-react) (高德官方 react 组件 )
- [react-amap](https://github.com/elemefe/react-amap)

## 贡献指南

查看[贡献指南](./Contributing.md)
Expand Down

0 comments on commit 830bb75

Please sign in to comment.