-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbbe0a6
commit 6bb7a10
Showing
22 changed files
with
483 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default { | ||
esm: 'rollup', | ||
cjs: 'rollup', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/npm-debug.log* | ||
/yarn-error.log | ||
/yarn.lock | ||
/package-lock.json | ||
|
||
# production | ||
/dist | ||
/docs-dist | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# umi | ||
.umi | ||
.umi-production | ||
.umi-test | ||
.env.local | ||
|
||
# ide | ||
/.vscode | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
registry = https://registry.npm.taobao.org | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**/*.svg | ||
**/*.ejs | ||
**/*.html | ||
package.json | ||
.umi | ||
.umi-production | ||
.umi-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"printWidth": 80, | ||
"overrides": [ | ||
{ | ||
"files": ".prettierrc", | ||
"options": { "parser": "json" } | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { defineConfig } from 'dumi'; | ||
|
||
export default defineConfig({ | ||
title: 'Taro-hooks', | ||
favicon: '/image/logo.png', | ||
logo: '/image/logo.png', | ||
outputPath: 'docs-dist', | ||
mode: 'site', | ||
devServer: { | ||
port: 12345, | ||
}, | ||
dynamicImport: {}, | ||
exportStatic: {}, | ||
navs: [ | ||
null, | ||
{ | ||
title: 'GitHub', | ||
path: 'https://github.com/innocces/taro-hooks', | ||
}, | ||
{ | ||
title: '更新日志', | ||
path: 'https://github.com/innocces/taro-hooks/releases', | ||
}, | ||
], | ||
links: [{ rel: 'stylesheet', href: '/assets/style.css' }], | ||
themeConfig: { | ||
hd: { | ||
// 根据不同的设备屏幕宽度断点切换高清方案 | ||
rules: [ | ||
{ maxWidth: 375, mode: 'vw', options: [100, 750] }, | ||
{ minWidth: 376, maxWidth: 750, mode: 'vw', options: [100, 1500] }, | ||
], | ||
// 更多 rule 配置访问 https://github.com/umijs/dumi/blob/master/packages/theme-mobile/src/typings/config.d.ts#L7 | ||
}, | ||
}, | ||
// more config: https://d.umijs.org/config | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry "https://registry.npm.taobao.org" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Taro-hooks | ||
|
||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)[![NPM version][image-1]][1] [![NPM downloads][image-2]][2][![node][image-3]][2][![license][image-4]][2] | ||
|
||
## 简介 | ||
|
||
为`Taro`而设计的`Hooks Library`. | ||
|
||
## 文档 | ||
|
||
[传送门]() | ||
|
||
## 使用案例 | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<a target="_blank" href=""> | ||
<img | ||
width="32" | ||
src="" | ||
/> | ||
<br> | ||
<strong>Taro-hooks weapp</strong> | ||
</a> | ||
</td> | ||
<td align="center"> | ||
<a target="_blank" href=""> | ||
<img | ||
width="32" | ||
style="vertical-align: -0.32em; margin-right: 8px;" | ||
src="" | ||
/> | ||
<br> | ||
<strong>Taro-hooks h5</strong> | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
## 特性 | ||
|
||
- 全面匹配`Taro API`. | ||
- 结合`ahooks`扩展常用`hook`. | ||
- 完整的类型定义文件 | ||
- 更易用的方式 | ||
|
||
## 安装 | ||
|
||
```bash | ||
$ npm i taro-hook --save | ||
``` | ||
|
||
## 使用 | ||
|
||
```jsx | ||
import { useEnv } from 'taro-hook'; | ||
``` | ||
|
||
## 参与贡献 | ||
|
||
```bash | ||
$ git clone git@github.com:innocces/taro-hooks.git | ||
$ cd taro-hooks | ||
$ yarn | ||
$ yarn start | ||
``` | ||
|
||
会自动打开浏览器 - [http://localhost:12345](http://localhost:12345) | ||
更多贡献详情见[官网文档]() | ||
|
||
## 交流讨论 | ||
|
||
<img src="" alt="wechat code" width="300"/> | ||
|
||
## License | ||
|
||
[MIT](./LICENSE) | ||
|
||
[1]: https://www.npmjs.com/package/taro-hooks | ||
[2]: https://npmjs.org/package/taro-hooks | ||
[image-1]: https://img.shields.io/npm/v/taro-hooks.svg?style=flat | ||
[image-2]: https://img.shields.io/npm/dm/taro-hooks.svg?style=flat | ||
[image-3]: https://img.shields.io/node/v/taro-hooks.svg?style=flat-square | ||
[image-4]: https://img.shields.io/npm/l/taro-hooks.svg?style=flat-square |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
hero: | ||
title: Taro-hooks | ||
desc: 为 Taro 而设计的 Hooks Library | ||
actions: | ||
- text: 快速上手 | ||
link: /quick | ||
features: | ||
- icon: https://taro.zone/static/images/icon_community.svg | ||
title: 全面匹配 | ||
desc: 对标Taro API开发 | ||
- icon: https://ahooks.js.org/logo.svg | ||
title: 结合ahook | ||
desc: 使用ahook拓展对应能力 | ||
- icon: https://taro.zone/static/images/icon_component.svg | ||
title: 类型定义 | ||
desc: 使用typescript开发, 完整的类型定义方便开发 | ||
footer: Open-source MIT Licensed | Copyright © 2021<br />Powered by [taro-hooks](https://github.com/innocces/taro-hooks) | ||
--- | ||
|
||
## 轻松使用 | ||
|
||
1. 安装依赖 | ||
|
||
```bash | ||
$ npm i taro-hooks --save | ||
``` | ||
|
||
2. 使用 | ||
|
||
```jsx | pure | ||
import { useEnv } from 'taro-hooks'; | ||
``` | ||
|
||
## 使用案例 | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<a target="_blank" href=""> | ||
<img | ||
width="32" | ||
src="http://s" | ||
/> | ||
<br> | ||
<strong>Taro-hooks weapp</strong> | ||
</a> | ||
</td> | ||
<td align="center"> | ||
<a target="_blank" href=""> | ||
<img | ||
width="32" | ||
style="vertical-align: -0.32em; margin-right: 8px;" | ||
src="http://s" | ||
/> | ||
<br> | ||
<strong>Taro-hooks h5</strong> | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
## 交流讨论 | ||
|
||
<div> | ||
<img data-type="dingtalk" src="https://g" width="300" /> | ||
<img data-type="wechat" src="http://111" width="300" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: FAQ | ||
--- | ||
|
||
<Alert type="info"> | ||
整理部分常见问题, 帮助快速解决问题 | ||
</Alert> | ||
|
||
### 1. 如何按需加载? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
nav: | ||
title: 指南 | ||
order: 1 | ||
title: 介绍 | ||
--- | ||
|
||
## 什么是 Taro-hooks? | ||
|
||
`Taro-hooks` - 一款对标`Taro API`开发的`Hooks Library`. 覆盖几乎所有`Taro API`以及方法. | ||
|
||
## 特性 | ||
|
||
- 全面匹配`Taro API`. | ||
- 结合`ahooks`扩展常用`hook`. | ||
- 完整的类型定义文件 | ||
- 更易用的方式 | ||
|
||
## 快速上手 | ||
|
||
### 环境准备 | ||
|
||
需要准备[node](https://nodejs.org/en/) | ||
|
||
```bash | ||
$ node -v | ||
# 确保node版本为12+ | ||
$ v12.22.1 | ||
``` | ||
|
||
### 脚手架初始化`Taro` | ||
|
||
`Taro-hooks`是以`React`模板编写的. 所以仅适用于`React`. | ||
|
||
```bash | ||
$ npx @tarojs/cli init taro-hooks-app | ||
# 选择react模板 | ||
$ cd taro-hooks-app | ||
$ npm i taro-hooks --save | ||
$ npm run dev:weapp --watch | ||
``` | ||
|
||
### 构建及部署 | ||
|
||
参考[taro build](https://taro-docs.jd.com/taro/docs/config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"packages": ["packages/*"], | ||
"command": { | ||
"version": { | ||
"allowBranch": "main", | ||
"includeMergedTags": true | ||
}, | ||
"publish": { | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
}, | ||
"useWorkspaces": true, | ||
"ignoreChanges": ["**/*.md", "**/es/*", "**/lib/*", "**/dist/*"], | ||
"version": "0.0.0" | ||
} |
Oops, something went wrong.