forked from ant-design/ant-design-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
267 changed files
with
24,072 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,15 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"loose": true, | ||
"modules": false | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"plugins": ["babel-plugin-transform-async-to-promises"], | ||
"ignore": ["**/demos"] | ||
} |
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,5 @@ | ||
const Api = () => { | ||
return 'hello' | ||
} | ||
|
||
export default Api |
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,55 @@ | ||
module.exports = { | ||
'env': { | ||
'browser': true, | ||
'es6': true, | ||
}, | ||
'extends': [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'prettier', | ||
'prettier/@typescript-eslint', | ||
'prettier/react', | ||
], | ||
'parser': '@typescript-eslint/parser', | ||
'parserOptions': { | ||
'project': 'tsconfig.json', | ||
'sourceType': 'module', | ||
}, | ||
'plugins': ['@typescript-eslint'], | ||
'rules': { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
'react/prop-types': 'off', | ||
'react/jsx-no-target-blank': 'off', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'no-case-declarations': 'off', | ||
'no-prototype-builtins': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'no-inner-declarations': 'off', | ||
'react/no-unescaped-entities': 'off', | ||
'no-empty': [ | ||
'error', | ||
{ | ||
allowEmptyCatch: true, | ||
}, | ||
], | ||
'no-constant-condition': [ | ||
'error', | ||
{ | ||
checkLoops: false, | ||
}, | ||
], | ||
// 下面的是临时规则 | ||
'react/display-name': 'off', | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
} |
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,19 @@ | ||
/node_modules/ | ||
/npm-debug.log | ||
/yarn-error.log | ||
/coverage/ | ||
.DS_Store | ||
.doc | ||
.umi | ||
.umi-production | ||
|
||
# build | ||
/dist/ | ||
/lib/ | ||
/es/ | ||
|
||
# dumi assets meta data | ||
/assets.json | ||
|
||
/.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,5 @@ | ||
packages/**/*.md | ||
packages/**/*.mdx | ||
package.json | ||
.umi | ||
.umi-production |
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,17 @@ | ||
module.exports = { | ||
'semi': false, | ||
'trailingComma': 'es5', | ||
'bracketSpacing': false, | ||
'tabWidth': 2, | ||
'singleQuote': true, | ||
'jsxBracketSameLine': false, | ||
'jsxSingleQuote': true, | ||
'quoteProps': 'preserve', | ||
'arrowParens': 'avoid', | ||
'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 @@ | ||
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,22 @@ | ||
MIT LICENSE | ||
|
||
Copyright (c) 2016-present Alipay.com, https://www.alipay.com/ | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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 @@ | ||
# Ant Design Mobile | ||
|
||
## 开发 | ||
|
||
```bash | ||
# 安装依赖 | ||
$ yarn install | ||
|
||
# 开发 | ||
$ yarn start | ||
``` |
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,107 @@ | ||
export default { | ||
mode: 'site', | ||
title: 'Ant Design Mobile', | ||
logo: 'https://gw.alipayobjects.com/mdn/rms_2ddd4c/afts/img/A*XGPHS5H4-GkAAAAAAAAAAAAAARQnAQ', | ||
navs: [ | ||
{ | ||
title: '组件', | ||
path: '/components', | ||
}, | ||
{ | ||
title: '文档', | ||
path: '/docs', | ||
}, | ||
], | ||
menus: { | ||
'/docs': [ | ||
{ | ||
title: '使用文档', | ||
children: ['quick-start'], | ||
}, | ||
], | ||
'/components': [ | ||
{ | ||
title: '基础组件', | ||
children: ['button'], | ||
}, | ||
{ | ||
title: '数据展示', | ||
children: [ | ||
'notice-bar', | ||
'water-mark', | ||
'steps', | ||
'index-bar', | ||
'tag', | ||
'desens-text', | ||
'infinite-scroll', | ||
'popover', | ||
'ellipsis', | ||
'badge', | ||
'image', | ||
'image-viewer', | ||
'empty', | ||
'card', | ||
], | ||
}, | ||
{ | ||
title: '数据录入', | ||
children: [ | ||
'input', | ||
'checkbox', | ||
'radio', | ||
'selector', | ||
'switch', | ||
'slider', | ||
'picker', | ||
'date-picker', | ||
'form', | ||
'cascader', | ||
'search', | ||
], | ||
}, | ||
{ | ||
title: '反馈', | ||
children: [ | ||
'dialog', | ||
'loading', | ||
'mask', | ||
'result', | ||
'toast', | ||
'error', | ||
'progress-bar', | ||
'progress-circle', | ||
'pull-to-refresh', | ||
'action-sheet', | ||
], | ||
}, | ||
{ | ||
title: '导航和布局', | ||
children: [ | ||
'list', | ||
'tabs', | ||
'space', | ||
'grid', | ||
'dropdown', | ||
'popup', | ||
'tab-bar', | ||
'divider', | ||
], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
includes: ['docs', 'src', 'src/components'], | ||
}, | ||
styles: [ | ||
`#root .__dumi-default-mobile-demo-layout { | ||
padding: 0; | ||
min-height: 100vh; | ||
background: #f5f5f5; | ||
}`, | ||
], | ||
themeConfig: { | ||
hd: { | ||
rules: [], | ||
}, | ||
}, | ||
} |
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,29 @@ | ||
# 快速上手 | ||
|
||
## 安装 | ||
|
||
```bash | ||
$ npm install --save antd-mobile | ||
# or | ||
$ yarn add antd-mobile | ||
``` | ||
|
||
## 引入 | ||
|
||
需要先在入口文件(例如 `app.ts`)中引入样式文件: | ||
|
||
```js | ||
import 'antd-mobile/lib/index.css' | ||
``` | ||
|
||
如果是 2 倍布局的话(例如 750 高清方案),需要引入 2x 版本的样式文件: | ||
|
||
```js | ||
import 'antd-mobile/lib/[email protected]' | ||
``` | ||
|
||
接下来就可以正常地使用组件了,例如: | ||
|
||
```js | ||
import {Button} from 'antd-mobile' | ||
``` |
Oops, something went wrong.