Skip to content

Commit b6d7782

Browse files
committed
first
0 parents  commit b6d7782

File tree

204 files changed

+29843
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+29843
-0
lines changed

.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [["env", { "modules": false, "loose": true }]],
3+
"plugins": ["transform-vue-jsx", "transform-runtime", "transform-object-rest-spread"],
4+
"env": {
5+
"commonjs": {
6+
"presets": [["env", { "modules": "commonjs", "loose": true }]]
7+
}
8+
}
9+
}

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
12+
13+
[*.js]
14+
indent_size = 2
15+
16+
[*.vue]
17+
indent_size = 2
18+
19+
[*.css]
20+
indent_size = 2
21+
22+
[Makefile]
23+
indent_style = tab

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib/
2+
dist/
3+
node_modules/
4+
build/**/*.js

.eslintrc.js

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
module.exports = {
2+
parserOptions: {
3+
ecmaVersion: 6,
4+
ecmaFeatures: {
5+
experimentalObjectRestSpread: true,
6+
jsx: true
7+
},
8+
sourceType: 'module'
9+
},
10+
11+
env: {
12+
es6: true,
13+
node: true,
14+
mocha: true
15+
},
16+
17+
plugins: ['vue'],
18+
19+
globals: {
20+
expect: true,
21+
sinon: true,
22+
zanui: true,
23+
document: false,
24+
navigator: false,
25+
window: false,
26+
require: true,
27+
FileReader: true,
28+
File: true
29+
},
30+
31+
rules: {
32+
'accessor-pairs': 2,
33+
'arrow-spacing': [2, { 'before': true, 'after': true }],
34+
'block-spacing': [2, 'always'],
35+
'brace-style': [2, '1tbs', { 'allowSingleLine': true }],
36+
'camelcase': [1, { 'properties': 'always' }],
37+
'comma-dangle': [2, 'never'],
38+
'comma-spacing': [2, { 'before': false, 'after': true }],
39+
'comma-style': [2, 'last'],
40+
'constructor-super': 2,
41+
'curly': [2, 'multi-line'],
42+
'dot-location': [2, 'property'],
43+
'eol-last': 2,
44+
'eqeqeq': [2, 'allow-null'],
45+
'generator-star-spacing': [2, { 'before': true, 'after': true }],
46+
'handle-callback-err': [2, '^(err|error)$' ],
47+
'indent': [2, 2, { 'SwitchCase': 1 }],
48+
'jsx-quotes': [2, 'prefer-double'],
49+
'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }],
50+
'keyword-spacing': [2, { 'before': true, 'after': true }],
51+
'new-cap': [2, { 'newIsCap': true, 'capIsNew': false }],
52+
'new-parens': 2,
53+
'no-array-constructor': 2,
54+
'no-caller': 2,
55+
'no-class-assign': 2,
56+
'no-cond-assign': 2,
57+
'no-const-assign': 2,
58+
'no-control-regex': 2,
59+
'no-delete-var': 2,
60+
'no-dupe-args': 2,
61+
'no-dupe-class-members': 2,
62+
'no-dupe-keys': 2,
63+
'no-duplicate-case': 2,
64+
'no-empty-character-class': 2,
65+
'no-empty-pattern': 2,
66+
'no-eval': 2,
67+
'no-ex-assign': 2,
68+
'no-extend-native': 2,
69+
'no-extra-bind': 2,
70+
'no-extra-boolean-cast': 2,
71+
'no-extra-parens': [2, 'functions'],
72+
'no-fallthrough': 2,
73+
'no-floating-decimal': 2,
74+
'no-func-assign': 2,
75+
'no-implied-eval': 2,
76+
'no-inner-declarations': [2, 'functions'],
77+
'no-invalid-regexp': 2,
78+
'no-irregular-whitespace': 2,
79+
'no-iterator': 2,
80+
'no-label-var': 2,
81+
'no-labels': [2, { 'allowLoop': false, 'allowSwitch': false }],
82+
'no-lone-blocks': 2,
83+
'no-mixed-spaces-and-tabs': 2,
84+
'no-multi-spaces': 2,
85+
'no-multi-str': 2,
86+
'no-multiple-empty-lines': [2, { 'max': 1 }],
87+
'no-native-reassign': 2,
88+
'no-negated-in-lhs': 2,
89+
'no-new-object': 2,
90+
'no-new-require': 2,
91+
'no-new-symbol': 2,
92+
'no-new-wrappers': 2,
93+
'no-obj-calls': 2,
94+
'no-octal': 2,
95+
'no-octal-escape': 2,
96+
'no-path-concat': 2,
97+
'no-proto': 2,
98+
'no-redeclare': 2,
99+
'no-regex-spaces': 2,
100+
'no-return-assign': [2, 'except-parens'],
101+
'no-self-assign': 2,
102+
'no-self-compare': 2,
103+
'no-sequences': 2,
104+
'no-shadow-restricted-names': 2,
105+
'no-spaced-func': 2,
106+
'no-sparse-arrays': 2,
107+
'no-this-before-super': 2,
108+
'no-throw-literal': 2,
109+
'no-trailing-spaces': 2,
110+
'no-undef': 2,
111+
'no-undef-init': 2,
112+
'no-unexpected-multiline': 2,
113+
'no-unmodified-loop-condition': 2,
114+
'no-unneeded-ternary': [2, { 'defaultAssignment': false }],
115+
'no-unreachable': 2,
116+
'no-unsafe-finally': 2,
117+
'no-unused-vars': [2, { 'vars': 'all', 'args': 'none' }],
118+
'no-useless-call': 2,
119+
'no-useless-computed-key': 2,
120+
'no-useless-constructor': 2,
121+
'no-useless-escape': 0,
122+
'no-whitespace-before-property': 2,
123+
'no-with': 2,
124+
'one-var': [2, { 'initialized': 'never' }],
125+
'operator-linebreak': [2, 'after', { 'overrides': { '?': 'before', ':': 'before' } }],
126+
'padded-blocks': [2, 'never'],
127+
'quotes': [2, 'single', { 'avoidEscape': true, 'allowTemplateLiterals': true }],
128+
'semi': [2, 'always'],
129+
'semi-spacing': [2, { 'before': false, 'after': true }],
130+
'space-before-blocks': [2, 'always'],
131+
'space-before-function-paren': [2, 'never'],
132+
'space-in-parens': [2, 'never'],
133+
'space-infix-ops': 2,
134+
'space-unary-ops': [2, { 'words': true, 'nonwords': false }],
135+
'spaced-comment': [2, 'always', { 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] }],
136+
'template-curly-spacing': [2, 'never'],
137+
'use-isnan': 2,
138+
'valid-typeof': 2,
139+
'wrap-iife': [2, 'any'],
140+
'yield-star-spacing': [2, 'both'],
141+
'yoda': [2, 'never'],
142+
'prefer-const': 2,
143+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
144+
'object-curly-spacing': [2, 'always', { objectsInObjects: false }],
145+
'array-bracket-spacing': [2, 'never'],
146+
'vue/jsx-uses-vars': 2
147+
}
148+
}

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.log*
2+
.cache
3+
.DS_Store
4+
.idea
5+
.vscode
6+
packages/**/lib
7+
lib/
8+
lib/*
9+
!lib/index.js
10+
!lib/style.css
11+
node_modules
12+
example/dist
13+
/docs/dist
14+
test/unit/coverage
15+
packages/vant-css/build
16+
packages/vant-css/icons
17+
docs/examples-dist

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
node_js:
3+
- 6
4+
os: linux
5+
cache:
6+
yarn: true
7+
branches:
8+
only:
9+
- master
10+
- dev
11+
install:
12+
- |
13+
yarn install
14+
script:
15+
- |
16+
npm run lint && npm run test
17+
after_success:
18+
- |
19+
cat ./test/unit/coverage/lcov.info | ./node_modules/.bin/codecov

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright 2017-present Youzan
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.
8+
9+
The MIT License (MIT)
10+
11+
Copyright (c) 2016 ElemeFE
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy
14+
of this software and associated documentation files (the "Software"), to deal
15+
in the Software without restriction, including without limitation the rights
16+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17+
copies of the Software, and to permit persons to whom the Software is
18+
furnished to do so, subject to the following conditions:
19+
20+
The above copyright notice and this permission notice shall be included in all
21+
copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29+
SOFTWARE.

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<p>
2+
<a href="https://github.com/youzan/"><img alt="有赞logo" width="36px" src="https://img.yzcdn.cn/public_files/2017/02/09/e84aa8cbbf7852688c86218c1f3bbf17.png" alt="youzan">
3+
</a>
4+
</p>
5+
<p align="center">
6+
<img alt="项目logo" src="https://img.yzcdn.cn/upload_files/2017/04/20/FlkVrSlOr-SGK9qQqtilN6-IFZyT.png">
7+
</p>
8+
<p align="center">A Vue.js 2.0 Mobile UI at YouZan</p>
9+
10+
[![Build Status](https://travis-ci.org/youzan/vant.svg?branch=master)](https://travis-ci.org/youzan/vant) [![Coverage Status](https://img.shields.io/codecov/c/github/youzan/vant/dev.svg)](https://codecov.io/github/youzan/vant?branch=dev) [![npm version](https://img.shields.io/npm/v/vant.svg?style=flat)](https://www.npmjs.com/package/vant) [![downloads](https://img.shields.io/npm/dt/vant.svg)](https://www.npmjs.com/package/vant)
11+
12+
[访问中文版](./README.zh-CN.md)
13+
14+
## Install
15+
16+
```shell
17+
npm i -S vant
18+
```
19+
20+
## Usage
21+
22+
### Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended)
23+
24+
```js
25+
// .babelrc or babel-loader option
26+
{
27+
"plugins": [
28+
["import", { "libraryName": "vant", "style": true }]
29+
]
30+
}
31+
```
32+
33+
Then you can import components from vant, equivalent to import manually below.
34+
35+
```js
36+
// import js and css modularly, parsed by babel-plugin-import
37+
import { Button } from 'vant';
38+
```
39+
40+
### Manually import
41+
42+
```jsx
43+
import { Button } from 'vant';
44+
import 'vant/lib/vant-css/button.css';
45+
```
46+
47+
48+
### Import all components
49+
50+
```javascript
51+
import Vue from 'vue';
52+
import vant from 'vant';
53+
import 'vant/lib/vant-css/index.css';
54+
55+
Vue.use(vant);
56+
```
57+
58+
## How to contribute
59+
60+
Please make sure to read the [Contributing Guide](./docs/examples-docs/en-US/contribute.md) before making a pull request.
61+
62+
## Preview
63+
64+
You can scan the following QR code to access the demo:
65+
66+
![zanui_vue_mobile_qrcode](https://img.yzcdn.cn/v2/image/youzanyun/zanui/pc/zanui_vue_mobile_preview_03.png)
67+
68+
## LICENSE
69+
70+
[MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89)

README.zh-CN.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<p>
2+
<a href="https://github.com/youzan/"><img alt="有赞logo" width="36px" src="https://img.yzcdn.cn/public_files/2017/02/09/e84aa8cbbf7852688c86218c1f3bbf17.png" alt="youzan">
3+
</a>
4+
</p>
5+
<p align="center">
6+
<img alt="项目logo" src="https://img.yzcdn.cn/upload_files/2017/04/20/FlkVrSlOr-SGK9qQqtilN6-IFZyT.png">
7+
</p>
8+
<p align="center">A Vue.js 2.0 Mobile UI at YouZan</p>
9+
10+
[![Build Status](https://travis-ci.org/youzan/vant.svg?branch=master)](https://travis-ci.org/youzan/vant) [![Coverage Status](https://img.shields.io/codecov/c/github/youzan/vant/dev.svg)](https://codecov.io/github/youzan/vant?branch=dev) [![npm version](https://img.shields.io/npm/v/vant.svg?style=flat)](https://www.npmjs.com/package/vant) [![downloads](https://img.shields.io/npm/dt/vant.svg)](https://www.npmjs.com/package/vant)
11+
12+
## 一、安装
13+
14+
```shell
15+
npm i -S vant
16+
```
17+
18+
## 二、使用
19+
20+
21+
### 使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (推荐)
22+
23+
```js
24+
// .babelrc or babel-loader option
25+
{
26+
"plugins": [
27+
["import", { "libraryName": "vant", "style": true }]
28+
]
29+
}
30+
```
31+
32+
  接着你可以直接引入 vant 组件,等价于下方的按需引入组件
33+
34+
```js
35+
  // 模块化地引入 js 和 css, 通过 babel-plugin-import 插件解析
36+
  import { Button } from 'vant';
37+
```
38+
39+
### 按需引入组件
40+
41+
```jsx
42+
import { Button } from 'vant/lib/button';
43+
import 'vant/lib/vant-css/button.css';
44+
```
45+
46+
### 导入所有组件
47+
48+
```javascript
49+
import Vue from 'vue';
50+
import vant from 'vant';
51+
import 'vant/lib/vant-css/index.css';
52+
53+
Vue.use(vant);
54+
```
55+
56+
## 三、贡献代码
57+
58+
修改代码请阅读我们的 [开发指南](./docs/examples-docs/zh-CN/contribute.md)
59+
60+
使用过程中发现任何问题都可以提 [Issue](https://github.com/youzan/vant/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://github.com/youzan/vant/pulls)
61+
62+
## 四、手机预览
63+
64+
可以手机扫码以下二维码访问手机端demo:
65+
66+
![zanui_vue_mobile_qrcode](https://img.yzcdn.cn/v2/image/youzanyun/zanui/pc/zanui_vue_mobile_preview_03.png)
67+
68+
## 五、开源协议
69+
70+
本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。

0 commit comments

Comments
 (0)