mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +00:00
Merge branch 'dev' of https://github.com/youzan/vant into dev
This commit is contained in:
3607
docs/demos/mock/area.js
Normal file
3607
docs/demos/mock/area.js
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
71
docs/demos/mock/areaEn.js
Normal file
71
docs/demos/mock/areaEn.js
Normal file
@@ -0,0 +1,71 @@
|
||||
export default {
|
||||
'province_list': {
|
||||
'110000': 'Beijing',
|
||||
'330000': 'Zhejiang',
|
||||
'810000': 'Hong Kong'
|
||||
},
|
||||
'city_list': {
|
||||
'110100': 'Beijing City',
|
||||
'330100': 'Hangzhou',
|
||||
'330200': 'Ningbo',
|
||||
'330300': 'Wenzhou',
|
||||
'330400': 'Jiaxin',
|
||||
'331100': 'Lishui',
|
||||
'810100': 'Hong Kong Island',
|
||||
'810200': 'Kowloon',
|
||||
'810300': 'New Territories'
|
||||
},
|
||||
'county_list': {
|
||||
'110101': 'Dongcheng',
|
||||
'110102': 'Xicheng',
|
||||
'110105': 'Chaoyang',
|
||||
'110106': 'Fengtai',
|
||||
'110108': 'Haidian',
|
||||
'110111': 'Fangshan',
|
||||
'110112': 'Tongzhou',
|
||||
'110113': 'Shunyi',
|
||||
'110114': 'Changping',
|
||||
'110115': 'Daxing',
|
||||
'330105': 'Gongshu',
|
||||
'330106': 'Xihu',
|
||||
'330108': 'Binjiang',
|
||||
'330109': 'Xiaoshan',
|
||||
'330110': 'Yuhang',
|
||||
'330111': 'Fuyang',
|
||||
'330127': 'Chunan',
|
||||
'330182': 'Jiande',
|
||||
'330185': 'Linan',
|
||||
'330206': 'Beilun',
|
||||
'330211': 'Zhenhai',
|
||||
'330225': 'Xiangshan',
|
||||
'330226': 'Ninghai',
|
||||
'330281': 'Yuyao',
|
||||
'330282': 'Cixi',
|
||||
'330327': 'Cangnan',
|
||||
'330328': 'Wencheng',
|
||||
'330329': 'Shuntai',
|
||||
'330381': 'Ruian',
|
||||
'330382': 'Yueqing',
|
||||
'330402': 'Nanhu',
|
||||
'330421': 'Jiashan',
|
||||
'330424': 'Haiyan',
|
||||
'330481': 'Haining',
|
||||
'330482': 'Pinghu',
|
||||
'330483': 'Tongxiang',
|
||||
'331102': 'Liandu District',
|
||||
'331121': 'Qingtian County',
|
||||
'331125': 'Yunhe County',
|
||||
'331181': 'Longquan County',
|
||||
'810101': 'Central',
|
||||
'810102': 'Wan Chai',
|
||||
'810202': 'Mong Kok',
|
||||
'810203': 'Sham Shui Po',
|
||||
'810204': 'Chuk Un',
|
||||
'810205': 'Kwun Tong',
|
||||
'810303': 'Sha Tin',
|
||||
'810305': 'Yuen Long',
|
||||
'810306': 'Tuen Mun',
|
||||
'810307': 'Tsuen Wan',
|
||||
'810309': 'Lantau Island'
|
||||
}
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
{
|
||||
"province_list": {
|
||||
"110000": "Beijing",
|
||||
"330000": "Zhejiang",
|
||||
"810000": "Hong Kong"
|
||||
},
|
||||
"city_list": {
|
||||
"110100": "Beijing City",
|
||||
"330100": "Hangzhou",
|
||||
"330200": "Ningbo",
|
||||
"330300": "Wenzhou",
|
||||
"330400": "Jiaxin",
|
||||
"331100": "Lishui",
|
||||
"810100": "Hong Kong Island",
|
||||
"810200": "Kowloon",
|
||||
"810300": "New Territories"
|
||||
},
|
||||
"county_list": {
|
||||
"110101": "Dongcheng",
|
||||
"110102": "Xicheng",
|
||||
"110105": "Chaoyang",
|
||||
"110106": "Fengtai",
|
||||
"110108": "Haidian",
|
||||
"110111": "Fangshan",
|
||||
"110112": "Tongzhou",
|
||||
"110113": "Shunyi",
|
||||
"110114": "Changping",
|
||||
"110115": "Daxing",
|
||||
"330105": "Gongshu",
|
||||
"330106": "Xihu",
|
||||
"330108": "Binjiang",
|
||||
"330109": "Xiaoshan",
|
||||
"330110": "Yuhang",
|
||||
"330111": "Fuyang",
|
||||
"330127": "Chunan",
|
||||
"330182": "Jiande",
|
||||
"330185": "Linan",
|
||||
"330206": "Beilun",
|
||||
"330211": "Zhenhai",
|
||||
"330225": "Xiangshan",
|
||||
"330226": "Ninghai",
|
||||
"330281": "Yuyao",
|
||||
"330282": "Cixi",
|
||||
"330327": "Cangnan",
|
||||
"330328": "Wencheng",
|
||||
"330329": "Shuntai",
|
||||
"330381": "Ruian",
|
||||
"330382": "Yueqing",
|
||||
"330402": "Nanhu",
|
||||
"330421": "Jiashan",
|
||||
"330424": "Haiyan",
|
||||
"330481": "Haining",
|
||||
"330482": "Pinghu",
|
||||
"330483": "Tongxiang",
|
||||
"331102": "Liandu District",
|
||||
"331121": "Qingtian County",
|
||||
"331125": "Yunhe County",
|
||||
"331181": "Longquan County",
|
||||
"810101": "Central",
|
||||
"810102": "Wan Chai",
|
||||
"810202": "Mong Kok",
|
||||
"810203": "Sham Shui Po",
|
||||
"810204": "Chuk Un",
|
||||
"810205": "Kwun Tong",
|
||||
"810303": "Sha Tin",
|
||||
"810305": "Yuen Long",
|
||||
"810306": "Tuen Mun",
|
||||
"810307": "Tsuen Wan",
|
||||
"810309": "Lantau Island"
|
||||
}
|
||||
}
|
@@ -16,7 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import areaList from '../mock/area.json';
|
||||
import areaList from '../mock/area';
|
||||
|
||||
export default {
|
||||
i18n: {
|
||||
|
@@ -15,8 +15,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AreaList from '../mock/area.json';
|
||||
import AreaListEn from '../mock/areaEn.json';
|
||||
import AreaList from '../mock/area';
|
||||
import AreaListEn from '../mock/areaEn';
|
||||
|
||||
export default {
|
||||
i18n: {
|
||||
|
@@ -54,7 +54,7 @@ export default {
|
||||
step2: '商家接单',
|
||||
step3: '买家提货',
|
||||
step4: '交易完成',
|
||||
title2: '物流描述',
|
||||
title2: '描述信息',
|
||||
title3: '竖向步骤条',
|
||||
status1: '【城市】物流状态1',
|
||||
status2: '【城市】物流状态',
|
||||
|
@@ -58,6 +58,14 @@
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('title8')">
|
||||
<van-tabs :active="active" swipeable>
|
||||
<van-tab :title="$t('tab') + index" v-for="index in tabs" :key="index">
|
||||
{{ $t('content') }} {{ index }}
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
@@ -71,7 +79,8 @@ export default {
|
||||
title4: '样式风格',
|
||||
title5: '点击事件',
|
||||
title6: '粘性布局',
|
||||
title7: '自定义标签'
|
||||
title7: '自定义标签',
|
||||
title8: '滑动切换'
|
||||
},
|
||||
'en-US': {
|
||||
tab: 'Tab ',
|
||||
@@ -81,7 +90,8 @@ export default {
|
||||
title4: 'Card Style',
|
||||
title5: 'Click Event',
|
||||
title6: 'Sticky',
|
||||
title7: 'Custom Tab'
|
||||
title7: 'Custom Tab',
|
||||
title8: 'Swipeable'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -106,7 +116,7 @@ export default {
|
||||
|
||||
<style lang="postcss">
|
||||
.demo-tab {
|
||||
margin-bottom: 500px;
|
||||
margin-bottom: 300px;
|
||||
|
||||
.van-tab .van-icon {
|
||||
margin-right: 5px;
|
||||
|
@@ -86,7 +86,7 @@ Example of `AreaList`
|
||||
}
|
||||
```
|
||||
|
||||
All code of China: [Area.json](https://github.com/youzan/vant/blob/dev/docs/demos/mock/area.json)
|
||||
All code of China: [Area.json](https://github.com/youzan/vant/blob/dev/docs/demos/mock/area.js)
|
||||
|
||||
#### argument of callback function confirm
|
||||
An array contains selected area objects.
|
||||
|
@@ -124,6 +124,18 @@ Use title slot to custom tab title
|
||||
</van-tabs>
|
||||
```
|
||||
|
||||
#### Swipeable
|
||||
|
||||
In swipeable mode, you can switch tabs with swipe gestrue in the content
|
||||
|
||||
```html
|
||||
<van-tabs :active="active" swipeable>
|
||||
<van-tab v-for="index in 4" :title="'tab ' + index">
|
||||
content {{ index }}
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
```
|
||||
|
||||
### Tabs API
|
||||
|
||||
| Attribute | Description | Type | Default | Accepted Values |
|
||||
@@ -132,6 +144,8 @@ Use title slot to custom tab title
|
||||
| active | Index of active tab | `String` `Number` | `0` | - |
|
||||
| duration | Toggle tab's animation time | `Number` | `0.2` | - | - |
|
||||
| swipe-threshold | Set swipe tabs threshold | `Number` | `4` | - | - |
|
||||
| sticky | Whether to use sticky mode | `Boolean` | `false` | - |
|
||||
| swipeable | Whether to switch tabs with swipe gestrue in the content | `Boolean` | `false` | - |
|
||||
|
||||
### Tab API
|
||||
|
||||
|
@@ -90,7 +90,7 @@ Vue.use(Area);
|
||||
}
|
||||
```
|
||||
|
||||
完整数据见 [Area.json](https://github.com/youzan/vant/blob/dev/docs/demos/mock/area.json)
|
||||
完整数据见 [Area.json](https://github.com/youzan/vant/blob/dev/docs/demos/mock/area.js)
|
||||
|
||||
#### 点击完成时返回的数据格式
|
||||
|
||||
|
@@ -15,10 +15,10 @@ Vue.use(Badge);
|
||||
|
||||
```html
|
||||
<van-badge-group :active-key="activeKey">
|
||||
<van-badge title="热销榜" @click="onClick" />
|
||||
<van-badge title="花式寿司" @click="onClick" info="8" />
|
||||
<van-badge title="火炽寿司" @click="onClick" info="99" />
|
||||
<van-badge title="手握寿司" @click="onClick" info="199" />
|
||||
<van-badge title="标签名称" @click="onClick" />
|
||||
<van-badge title="标签名称" @click="onClick" info="8" />
|
||||
<van-badge title="标签名称" @click="onClick" info="99" />
|
||||
<van-badge title="标签名称" @click="onClick" info="199" />
|
||||
</van-badge-group>
|
||||
```
|
||||
|
||||
|
@@ -86,7 +86,7 @@ Vue.use(Field);
|
||||
placeholder="请输入留言"
|
||||
rows="1"
|
||||
autosize
|
||||
/>
|
||||
/>
|
||||
</van-cell-group>
|
||||
```
|
||||
|
||||
|
@@ -30,9 +30,9 @@ export default {
|
||||
}
|
||||
```
|
||||
|
||||
#### 物流描述
|
||||
#### 描述信息
|
||||
|
||||
通过`title`和`description`属性来定义物流描述信息
|
||||
通过`title`和`description`属性来定义描述信息信息
|
||||
|
||||
```html
|
||||
<van-steps
|
||||
|
@@ -124,6 +124,18 @@ export default {
|
||||
</van-tabs>
|
||||
```
|
||||
|
||||
#### 滑动切换
|
||||
|
||||
通过`swipeable`属性可以开启滑动切换tab
|
||||
|
||||
```html
|
||||
<van-tabs :active="active" swipeable>
|
||||
<van-tab v-for="index in 4" :title="'选项 ' + index">
|
||||
内容 {{ index }}
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
```
|
||||
|
||||
### Tabs API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | 可选 |
|
||||
@@ -133,6 +145,7 @@ export default {
|
||||
| duration | 切换 tab 的动画时间 | `Number` | `0.2` | - |
|
||||
| swipe-threshold | 滚动阀值,设置 Tab 超过多少个可滚动 | `Number` | `4` | - |
|
||||
| sticky | 是否使用粘性定位布局 | `Boolean` | `false` | - |
|
||||
| swipeable | 是否可以滑动内容切换 | `Boolean` | `false` | - |
|
||||
|
||||
### Tab API
|
||||
|
||||
|
Reference in New Issue
Block a user