mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
merge: merge master&&rebuild docs
This commit is contained in:
commit
ea8ef564b9
20
docs/build/0.js
vendored
20
docs/build/0.js
vendored
File diff suppressed because one or more lines are too long
12
docs/build/zanui-docs.js
vendored
12
docs/build/zanui-docs.js
vendored
File diff suppressed because one or more lines are too long
12
docs/build/zanui-examples.js
vendored
12
docs/build/zanui-examples.js
vendored
File diff suppressed because one or more lines are too long
@ -3,13 +3,12 @@
|
|||||||
</zan-card>
|
</zan-card>
|
||||||
|
|
||||||
</example-block><example-block title="高级用法">
|
</example-block><example-block title="高级用法">
|
||||||
<zan-card title="商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余" desc="商品SKU1,商品SKU2" thumb="https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg">
|
<zan-card thumb="https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg">
|
||||||
<div class="zan-card__row" slot="title">
|
<div class="zan-card__row" slot="title">
|
||||||
<h4 class="zan-card__title">商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余</h4>
|
<h4 class="zan-card__title">商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余</h4>
|
||||||
<span class="zan-card__price">¥ 2.00</span>
|
<span class="zan-card__price">¥ 2.00</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="zan-card__row" slot="desc">
|
<div class="zan-card__row" slot="desc">
|
||||||
<h4 class="zan-card__desc">商品sku</h4>
|
|
||||||
<span class="zan-card__num">x 2</span>
|
<span class="zan-card__num">x 2</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="zan-card__footer" slot="footer">
|
<div class="zan-card__footer" slot="footer">
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
<template><section class="demo-picker"><h1 class="demo-title">picker</h1><example-block title="基础用法">
|
<template><section class="demo-picker"><h1 class="demo-title">picker</h1><example-block title="基础用法">
|
||||||
<zan-picker :columns="pickerColumns" @change="handlePickerChange"></zan-picker>
|
<zan-picker :columns="pickerColumns" @change="handlePickerChange"></zan-picker>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</example-block><example-block title="带toolbar的Picker">
|
</example-block><example-block title="带toolbar的Picker">
|
||||||
<zan-picker :columns="pickerColumns" show-toolbar="" @change="handlePickerChange" @cancel="handlePickerCancel" @confirm="handlePickerConfirm"></zan-picker>
|
<zan-picker :columns="pickerColumns" show-toolbar="" @change="handlePickerChange" @cancel="handlePickerCancel" @confirm="handlePickerConfirm"></zan-picker>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</example-block></section></template>
|
</example-block></section></template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -22,13 +22,13 @@
|
|||||||
</example-block><example-block title="自定义颜色">
|
</example-block><example-block title="自定义颜色">
|
||||||
|
|
||||||
<div class="demo-progress__wrapper">
|
<div class="demo-progress__wrapper">
|
||||||
<zan-progress class="demo-progress__demo1" pivottext="红色" color="#ed5050" :percentage="26"></zan-progress>
|
<zan-progress class="demo-progress__demo1" pivot-text="红色" color="#ed5050" :percentage="26"></zan-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="demo-progress__wrapper">
|
<div class="demo-progress__wrapper">
|
||||||
<zan-progress class="demo-progress__demo1" pivottext="橙色" color="#f60" :percentage="46"></zan-progress>
|
<zan-progress class="demo-progress__demo1" pivot-text="橙色" color="#f60" :percentage="46"></zan-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="demo-progress__wrapper">
|
<div class="demo-progress__wrapper">
|
||||||
<zan-progress class="demo-progress__demo1" pivottext="黄色" color="#f09000" :percentage="66"></zan-progress>
|
<zan-progress class="demo-progress__demo1" pivot-text="黄色" color="#f09000" :percentage="66"></zan-progress>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</example-block></section></template>
|
</example-block></section></template>
|
||||||
@ -36,7 +36,6 @@
|
|||||||
@component-namespace demo {
|
@component-namespace demo {
|
||||||
@b progress {
|
@b progress {
|
||||||
@e wrapper {
|
@e wrapper {
|
||||||
width: 100%;
|
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 20px 10px;
|
margin: 20px 10px;
|
||||||
}
|
}
|
||||||
|
@ -21,15 +21,12 @@
|
|||||||
:::demo 高级用法
|
:::demo 高级用法
|
||||||
```html
|
```html
|
||||||
<zan-card
|
<zan-card
|
||||||
title="商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余"
|
|
||||||
desc="商品SKU1,商品SKU2"
|
|
||||||
thumb="https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg">
|
thumb="https://img.yzcdn.cn/upload_files/2017/02/17/FnDwvwHmU-OiqsbjAO5X7wh1KWrR.jpg!100x100.jpg">
|
||||||
<div class="zan-card__row" slot="title">
|
<div class="zan-card__row" slot="title">
|
||||||
<h4 class="zan-card__title">商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余</h4>
|
<h4 class="zan-card__title">商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余</h4>
|
||||||
<span class="zan-card__price">¥ 2.00</span>
|
<span class="zan-card__price">¥ 2.00</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="zan-card__row" slot="desc">
|
<div class="zan-card__row" slot="desc">
|
||||||
<h4 class="zan-card__desc">商品sku</h4>
|
|
||||||
<span class="zan-card__num">x 2</span>
|
<span class="zan-card__num">x 2</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="zan-card__footer" slot="footer">
|
<div class="zan-card__footer" slot="footer">
|
||||||
|
@ -44,6 +44,37 @@ export default {
|
|||||||
:::demo 基础用法
|
:::demo 基础用法
|
||||||
```html
|
```html
|
||||||
<zan-picker :columns="pickerColumns" @change="handlePickerChange"></zan-picker>
|
<zan-picker :columns="pickerColumns" @change="handlePickerChange"></zan-picker>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const citys = {
|
||||||
|
'浙江': ['杭州', '宁波', '温州', '嘉兴', '湖州', '绍兴', '金华', '衢州', '舟山', '台州', '丽水'],
|
||||||
|
'福建': ['福州', '厦门', '莆田', '三明', '泉州', '漳州', '南平', '龙岩', '宁德'],
|
||||||
|
'湖南': ['长沙', '株洲', '湘潭', '衡阳', '邵阳', '岳阳', '常德', '张家界', '益阳', '郴州', '永州', '怀化', '娄底', '湘西土家族苗族自治州']
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pickerColumns: [
|
||||||
|
{
|
||||||
|
values: Object.keys(citys),
|
||||||
|
className: 'column1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
values: ['杭州', '宁波', '温州', '嘉兴', '湖州', '绍兴', '金华', '衢州', '舟山', '台州', '丽水'],
|
||||||
|
className: 'column2'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handlePickerChange(picker, values) {
|
||||||
|
picker.setColumnValues(1, citys[values[0]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
@ -52,6 +83,43 @@ export default {
|
|||||||
:::demo 带toolbar的Picker
|
:::demo 带toolbar的Picker
|
||||||
```html
|
```html
|
||||||
<zan-picker :columns="pickerColumns" show-toolbar @change="handlePickerChange" @cancel="handlePickerCancel" @confirm="handlePickerConfirm"></zan-picker>
|
<zan-picker :columns="pickerColumns" show-toolbar @change="handlePickerChange" @cancel="handlePickerCancel" @confirm="handlePickerConfirm"></zan-picker>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const citys = {
|
||||||
|
'浙江': ['杭州', '宁波', '温州', '嘉兴', '湖州', '绍兴', '金华', '衢州', '舟山', '台州', '丽水'],
|
||||||
|
'福建': ['福州', '厦门', '莆田', '三明', '泉州', '漳州', '南平', '龙岩', '宁德'],
|
||||||
|
'湖南': ['长沙', '株洲', '湘潭', '衡阳', '邵阳', '岳阳', '常德', '张家界', '益阳', '郴州', '永州', '怀化', '娄底', '湘西土家族苗族自治州']
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pickerColumns: [
|
||||||
|
{
|
||||||
|
values: Object.keys(citys),
|
||||||
|
className: 'column1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
values: ['杭州', '宁波', '温州', '嘉兴', '湖州', '绍兴', '金华', '衢州', '舟山', '台州', '丽水'],
|
||||||
|
className: 'column2'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
handlePickerChange(picker, values) {
|
||||||
|
picker.setColumnValues(1, citys[values[0]]);
|
||||||
|
},
|
||||||
|
handlePickerCancel() {
|
||||||
|
alert('picker cancel');
|
||||||
|
},
|
||||||
|
handlePickerConfirm() {
|
||||||
|
alert('picker confirm');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
```
|
```
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<h4 v-text="title" class="zan-card__title"></h4>
|
<h4 v-text="title" class="zan-card__title"></h4>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="desc">
|
<slot name="desc">
|
||||||
<p v-if="desc" v-text="desc" class="zan-card__title"></p>
|
<p v-if="desc" v-text="desc" class="zan-card__desc"></p>
|
||||||
</slot>
|
</slot>
|
||||||
<slot name="tags"></slot>
|
<slot name="tags"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
class="zan-picker-column__item"
|
class="zan-picker-column__item"
|
||||||
:class="{ 'zan-picker-column__item--selected': item === currentValue }"
|
:class="{ 'zan-picker-column__item--selected': item === currentValue }"
|
||||||
:style="{ height: itemHeight + 'px', lineHeight: itemHeight + 'px' }">
|
:style="{ height: itemHeight + 'px', lineHeight: itemHeight + 'px' }">
|
||||||
{{item}}
|
{{ typeof item === 'object' && item[valueKey] ? item[valueKey] : item }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -52,7 +52,8 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: DEFAULT_ITEM_HEIGHT
|
default: DEFAULT_ITEM_HEIGHT
|
||||||
},
|
},
|
||||||
value: {}
|
value: {},
|
||||||
|
valueKey: String
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
:class-name="item.className"
|
:class-name="item.className"
|
||||||
:itemHeight="itemHeight"
|
:itemHeight="itemHeight"
|
||||||
:visible-item-count="visibleItemCount"
|
:visible-item-count="visibleItemCount"
|
||||||
@change="columnValueChange">
|
:value-key="valueKey"
|
||||||
|
@change="columnValueChange(index)">
|
||||||
</picker-column>
|
</picker-column>
|
||||||
<div class="zan-picker-center-highlight" :style="{ height: itemHeight + 'px', marginTop: -itemHeight / 2 + 'px' }"></div>
|
<div class="zan-picker-center-highlight" :style="{ height: itemHeight + 'px', marginTop: -itemHeight / 2 + 'px' }"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -63,7 +64,8 @@ export default {
|
|||||||
showToolbar: {
|
showToolbar: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}
|
},
|
||||||
|
valueKey: String
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
@ -81,16 +83,16 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
handlePickerCancel() {
|
handlePickerCancel() {
|
||||||
this.$emit('cancel');
|
this.$emit('cancel', this.values);
|
||||||
},
|
},
|
||||||
handlePickerConfirm() {
|
handlePickerConfirm() {
|
||||||
this.$emit('confirm');
|
this.$emit('confirm', this.values);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 处理列`change`事件
|
* 处理列`change`事件
|
||||||
*/
|
*/
|
||||||
columnValueChange() {
|
columnValueChange(index) {
|
||||||
this.$emit('change', this, this.values);
|
this.$emit('change', this, this.values, index);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
@component-namespace zan {
|
@component-namespace zan {
|
||||||
@b card {
|
@b card {
|
||||||
padding: 5px 15px;
|
padding: 5px 15px 5px 115px;
|
||||||
|
height: 90px;
|
||||||
background: #FAFAFA;
|
background: #FAFAFA;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -13,15 +14,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@e img {
|
@e img {
|
||||||
float: left;
|
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
border: 0;
|
border: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@e content {
|
@e content {
|
||||||
margin-left: 100px;
|
|
||||||
display: table;
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
@when center {
|
@when center {
|
||||||
display: table;
|
display: table;
|
||||||
@ -45,6 +48,7 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
max-height: 40px;
|
max-height: 40px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
word-break: break-all;
|
||||||
@mixin multi-ellipsis 2;
|
@mixin multi-ellipsis 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +56,7 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #666;
|
color: #666;
|
||||||
max-height: 20px;
|
max-height: 20px;
|
||||||
|
word-break: break-all;
|
||||||
@mixin multi-ellipsis 1;
|
@mixin multi-ellipsis 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user