mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-25 10:56:35 +08:00
docs: make document more compact
This commit is contained in:
parent
bb53c3c758
commit
3a4107ef49
@ -21,7 +21,6 @@ The `confirm` event will be triggered after the date selection is completed
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="Select Single Date" :value="date" @click="show = true" />
|
<van-cell title="Select Single Date" :value="date" @click="show = true" />
|
||||||
|
|
||||||
<van-calendar v-model="show" @confirm="onConfirm" />
|
<van-calendar v-model="show" @confirm="onConfirm" />
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
return `${date.getMonth() + 1}/${date.getDate()}`;
|
return `${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
@ -52,7 +50,6 @@ You can select a date range after setting `type` to` range`. In range mode, the
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="Select Date Range" :value="date" @click="show = true" />
|
<van-cell title="Select Date Range" :value="date" @click="show = true" />
|
||||||
|
|
||||||
<van-calendar v-model="show" type="range" @confirm="onConfirm" />
|
<van-calendar v-model="show" type="range" @confirm="onConfirm" />
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -64,7 +61,6 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
return `${date.getMonth() + 1}/${date.getDate()}`;
|
return `${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
|
@ -21,7 +21,6 @@ Vue.use(Calendar);
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="选择单个日期" :value="date" @click="show = true" />
|
<van-cell title="选择单个日期" :value="date" @click="show = true" />
|
||||||
|
|
||||||
<van-calendar v-model="show" @confirm="onConfirm" />
|
<van-calendar v-model="show" @confirm="onConfirm" />
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -33,7 +32,6 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
return `${date.getMonth() + 1}/${date.getDate()}`;
|
return `${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
@ -52,7 +50,6 @@ export default {
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell title="选择日期区间" :value="date" @click="show = true" />
|
<van-cell title="选择日期区间" :value="date" @click="show = true" />
|
||||||
|
|
||||||
<van-calendar v-model="show" type="range" @confirm="onConfirm" />
|
<van-calendar v-model="show" type="range" @confirm="onConfirm" />
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -64,7 +61,6 @@ export default {
|
|||||||
show: false
|
show: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
return `${date.getMonth() + 1}/${date.getDate()}`;
|
return `${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
|
@ -64,11 +64,7 @@ export default {
|
|||||||
<div slot="title">Title1 <van-icon name="question-o" /></div>
|
<div slot="title">Title1 <van-icon name="question-o" /></div>
|
||||||
Content
|
Content
|
||||||
</van-collapse-item>
|
</van-collapse-item>
|
||||||
<van-collapse-item
|
<van-collapse-item title="Title2" name="2" icon="shop-o">
|
||||||
title="Title2"
|
|
||||||
name="2"
|
|
||||||
icon="shop-o"
|
|
||||||
>
|
|
||||||
Content
|
Content
|
||||||
</van-collapse-item>
|
</van-collapse-item>
|
||||||
</van-collapse>
|
</van-collapse>
|
||||||
|
@ -64,12 +64,7 @@ export default {
|
|||||||
<div slot="title">标题1 <van-icon name="question-o" /></div>
|
<div slot="title">标题1 <van-icon name="question-o" /></div>
|
||||||
内容
|
内容
|
||||||
</van-collapse-item>
|
</van-collapse-item>
|
||||||
|
<van-collapse-item title="标题2" name="2" icon="shop-o">
|
||||||
<van-collapse-item
|
|
||||||
title="标题2"
|
|
||||||
name="2"
|
|
||||||
icon="shop-o"
|
|
||||||
>
|
|
||||||
内容
|
内容
|
||||||
</van-collapse-item>
|
</van-collapse-item>
|
||||||
</van-collapse>
|
</van-collapse>
|
||||||
|
@ -30,20 +30,13 @@ export default {
|
|||||||
### Custom Format
|
### Custom Format
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-count-down
|
<van-count-down :time="time" format="DD Day, HH:mm:ss" />
|
||||||
:time="time"
|
|
||||||
format="DD Day, HH:mm:ss"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Millisecond
|
### Millisecond
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-count-down
|
<van-count-down millisecond :time="time" format="HH:mm:ss:SS" />
|
||||||
millisecond
|
|
||||||
:time="time"
|
|
||||||
format="HH:mm:ss:SS"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Style
|
### Custom Style
|
||||||
|
@ -34,10 +34,7 @@ export default {
|
|||||||
通过`format`属性设置倒计时文本的内容
|
通过`format`属性设置倒计时文本的内容
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-count-down
|
<van-count-down :time="time" format="DD 天 HH 时 mm 分 ss 秒" />
|
||||||
:time="time"
|
|
||||||
format="DD 天 HH 时 mm 分 ss 秒"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 毫秒级渲染
|
### 毫秒级渲染
|
||||||
@ -45,11 +42,7 @@ export default {
|
|||||||
倒计时默认每秒渲染一次,设置`millisecond`属性可以开启毫秒级渲染
|
倒计时默认每秒渲染一次,设置`millisecond`属性可以开启毫秒级渲染
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-count-down
|
<van-count-down millisecond :time="time" format="HH:mm:ss:SS" />
|
||||||
millisecond
|
|
||||||
:time="time"
|
|
||||||
format="HH:mm:ss:SS"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 自定义样式
|
### 自定义样式
|
||||||
|
@ -21,7 +21,6 @@ Vue.use(CouponList);
|
|||||||
:chosen-coupon="chosenCoupon"
|
:chosen-coupon="chosenCoupon"
|
||||||
@click="showList = true"
|
@click="showList = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Coupon List -->
|
<!-- Coupon List -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="showList"
|
v-model="showList"
|
||||||
@ -60,7 +59,6 @@ export default {
|
|||||||
disabledCoupons: [coupon]
|
disabledCoupons: [coupon]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onChange(index) {
|
onChange(index) {
|
||||||
this.showList = false;
|
this.showList = false;
|
||||||
|
@ -21,7 +21,6 @@ Vue.use(CouponList);
|
|||||||
:chosen-coupon="chosenCoupon"
|
:chosen-coupon="chosenCoupon"
|
||||||
@click="showList = true"
|
@click="showList = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 优惠券列表 -->
|
<!-- 优惠券列表 -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="showList"
|
v-model="showList"
|
||||||
@ -60,7 +59,6 @@ export default {
|
|||||||
disabledCoupons: [coupon]
|
disabledCoupons: [coupon]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onChange(index) {
|
onChange(index) {
|
||||||
this.showList = false;
|
this.showList = false;
|
||||||
|
@ -82,11 +82,7 @@ export default {
|
|||||||
If you need to render vue components within a dialog, you can use dialog component.
|
If you need to render vue components within a dialog, you can use dialog component.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-dialog
|
<van-dialog v-model="show" title="Title" show-cancel-button>
|
||||||
v-model="show"
|
|
||||||
title="Title"
|
|
||||||
show-cancel-button
|
|
||||||
>
|
|
||||||
<img src="https://img.yzcdn.cn/vant/apple-3.jpg">
|
<img src="https://img.yzcdn.cn/vant/apple-3.jpg">
|
||||||
</van-dialog>
|
</van-dialog>
|
||||||
```
|
```
|
||||||
|
@ -108,11 +108,7 @@ export default {
|
|||||||
如果需要在弹窗内嵌入组件或其他自定义内容,可以使用组件调用的方式
|
如果需要在弹窗内嵌入组件或其他自定义内容,可以使用组件调用的方式
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-dialog
|
<van-dialog v-model="show" title="标题" show-cancel-button>
|
||||||
v-model="show"
|
|
||||||
title="标题"
|
|
||||||
show-cancel-button
|
|
||||||
>
|
|
||||||
<img src="https://img.yzcdn.cn/vant/apple-3.jpg">
|
<img src="https://img.yzcdn.cn/vant/apple-3.jpg">
|
||||||
</van-dialog>
|
</van-dialog>
|
||||||
```
|
```
|
||||||
|
@ -69,7 +69,6 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onConfirm() {
|
onConfirm() {
|
||||||
this.$refs.item.toggle();
|
this.$refs.item.toggle();
|
||||||
|
@ -71,7 +71,6 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onConfirm() {
|
onConfirm() {
|
||||||
this.$refs.item.toggle();
|
this.$refs.item.toggle();
|
||||||
|
@ -54,11 +54,7 @@ setTimeout(() => {
|
|||||||
### Component Call
|
### Component Call
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-image-preview
|
<van-image-preview v-model="show" :images="images" @change="onChange">
|
||||||
v-model="show"
|
|
||||||
:images="images"
|
|
||||||
@change="onChange"
|
|
||||||
>
|
|
||||||
<template v-slot:index>Page: {{ index }}</template>
|
<template v-slot:index>Page: {{ index }}</template>
|
||||||
</van-image-preview>
|
</van-image-preview>
|
||||||
```
|
```
|
||||||
|
@ -64,11 +64,7 @@ setTimeout(() => {
|
|||||||
如果需要在图片预览内嵌入组件或其他自定义内容,可以使用组件调用的方式,调用前需要通过 `Vue.use` 注册组件
|
如果需要在图片预览内嵌入组件或其他自定义内容,可以使用组件调用的方式,调用前需要通过 `Vue.use` 注册组件
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-image-preview
|
<van-image-preview v-model="show" :images="images" @change="onChange">
|
||||||
v-model="show"
|
|
||||||
:images="images"
|
|
||||||
@change="onChange"
|
|
||||||
>
|
|
||||||
<template v-slot:index>第{{ index }}页</template>
|
<template v-slot:index>第{{ index }}页</template>
|
||||||
</van-image-preview>
|
</van-image-preview>
|
||||||
```
|
```
|
||||||
|
@ -24,11 +24,7 @@ Vue.use(List);
|
|||||||
finished-text="Finished"
|
finished-text="Finished"
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
>
|
>
|
||||||
<van-cell
|
<van-cell v-for="item in list" :key="item" :title="item" />
|
||||||
v-for="item in list"
|
|
||||||
:key="item"
|
|
||||||
:title="item"
|
|
||||||
/>
|
|
||||||
</van-list>
|
</van-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -68,11 +64,7 @@ export default {
|
|||||||
error-text="Request failed. Click to reload"
|
error-text="Request failed. Click to reload"
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
>
|
>
|
||||||
<van-cell
|
<van-cell v-for="item in list" :key="item" :title="item" />
|
||||||
v-for="item in list"
|
|
||||||
:key="item"
|
|
||||||
:title="item"
|
|
||||||
/>
|
|
||||||
</van-list>
|
</van-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -26,11 +26,7 @@ List 组件通过`loading`和`finished`两个变量控制加载状态,当组
|
|||||||
finished-text="没有更多了"
|
finished-text="没有更多了"
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
>
|
>
|
||||||
<van-cell
|
<van-cell v-for="item in list" :key="item" :title="item" />
|
||||||
v-for="item in list"
|
|
||||||
:key="item"
|
|
||||||
:title="item"
|
|
||||||
/>
|
|
||||||
</van-list>
|
</van-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -75,11 +71,7 @@ export default {
|
|||||||
error-text="请求失败,点击重新加载"
|
error-text="请求失败,点击重新加载"
|
||||||
@load="onLoad"
|
@load="onLoad"
|
||||||
>
|
>
|
||||||
<van-cell
|
<van-cell v-for="item in list" :key="item" :title="item" />
|
||||||
v-for="item in list"
|
|
||||||
:key="item"
|
|
||||||
:title="item"
|
|
||||||
/>
|
|
||||||
</van-list>
|
</van-list>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -14,10 +14,7 @@ Vue.use(NoticeBar);
|
|||||||
### Basic Usage
|
### Basic Usage
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-notice-bar
|
<van-notice-bar text="Notice Content" left-icon="volume-o" />
|
||||||
text="Notice Content"
|
|
||||||
left-icon="volume-o"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Disable scroll
|
### Disable scroll
|
||||||
|
@ -14,10 +14,7 @@ Vue.use(NoticeBar);
|
|||||||
### 基础用法
|
### 基础用法
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-notice-bar
|
<van-notice-bar text="通知内容" left-icon="volume-o" />
|
||||||
text="通知内容"
|
|
||||||
left-icon="volume-o"
|
|
||||||
/>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 禁用滚动
|
### 禁用滚动
|
||||||
|
@ -17,7 +17,6 @@ Vue.use(NumberKeyboard);
|
|||||||
<van-button @touchstart.stop="show = true">
|
<van-button @touchstart.stop="show = true">
|
||||||
Show Keyboard
|
Show Keyboard
|
||||||
</van-button>
|
</van-button>
|
||||||
|
|
||||||
<van-number-keyboard
|
<van-number-keyboard
|
||||||
:show="show"
|
:show="show"
|
||||||
extra-key="."
|
extra-key="."
|
||||||
|
@ -21,7 +21,6 @@ Vue.use(NumberKeyboard);
|
|||||||
<van-button @touchstart.stop="show = true">
|
<van-button @touchstart.stop="show = true">
|
||||||
弹出默认键盘
|
弹出默认键盘
|
||||||
</van-button>
|
</van-button>
|
||||||
|
|
||||||
<van-number-keyboard
|
<van-number-keyboard
|
||||||
:show="show"
|
:show="show"
|
||||||
extra-key="."
|
extra-key="."
|
||||||
|
@ -15,7 +15,6 @@ Vue.use(Overlay);
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-button type="primary" text="Show Overlay" @click="show = true" />
|
<van-button type="primary" text="Show Overlay" @click="show = true" />
|
||||||
|
|
||||||
<van-overlay :show="show" @click="show = false" />
|
<van-overlay :show="show" @click="show = false" />
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ Vue.use(Overlay);
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-button type="primary" text="显示遮罩层" @click="show = true" />
|
<van-button type="primary" text="显示遮罩层" @click="show = true" />
|
||||||
|
|
||||||
<van-overlay :show="show" @click="show = false" />
|
<van-overlay :show="show" @click="show = false" />
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ Vue.use(NumberKeyboard);
|
|||||||
:focused="showKeyboard"
|
:focused="showKeyboard"
|
||||||
@focus="showKeyboard = true"
|
@focus="showKeyboard = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- NumberKeyboard -->
|
<!-- NumberKeyboard -->
|
||||||
<van-number-keyboard
|
<van-number-keyboard
|
||||||
:show="showKeyboard"
|
:show="showKeyboard"
|
||||||
@ -44,7 +43,6 @@ export default {
|
|||||||
showKeyboard: true
|
showKeyboard: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(key) {
|
onInput(key) {
|
||||||
this.value = (this.value + key).slice(0, 6);
|
this.value = (this.value + key).slice(0, 6);
|
||||||
@ -110,7 +108,6 @@ export default {
|
|||||||
errorInfo: ''
|
errorInfo: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(key) {
|
onInput(key) {
|
||||||
this.value = (this.value + key).slice(0, 6);
|
this.value = (this.value + key).slice(0, 6);
|
||||||
|
@ -26,7 +26,6 @@ Vue.use(NumberKeyboard);
|
|||||||
:focused="showKeyboard"
|
:focused="showKeyboard"
|
||||||
@focus="showKeyboard = true"
|
@focus="showKeyboard = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 数字键盘 -->
|
<!-- 数字键盘 -->
|
||||||
<van-number-keyboard
|
<van-number-keyboard
|
||||||
:show="showKeyboard"
|
:show="showKeyboard"
|
||||||
@ -44,7 +43,6 @@ export default {
|
|||||||
showKeyboard: true
|
showKeyboard: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(key) {
|
onInput(key) {
|
||||||
this.value = (this.value + key).slice(0, 6);
|
this.value = (this.value + key).slice(0, 6);
|
||||||
@ -91,7 +89,6 @@ export default {
|
|||||||
:focused="showKeyboard"
|
:focused="showKeyboard"
|
||||||
@focus="showKeyboard = true"
|
@focus="showKeyboard = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 数字键盘 -->
|
<!-- 数字键盘 -->
|
||||||
<van-number-keyboard
|
<van-number-keyboard
|
||||||
:show="showKeyboard"
|
:show="showKeyboard"
|
||||||
@ -110,7 +107,6 @@ export default {
|
|||||||
errorInfo: ''
|
errorInfo: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(key) {
|
onInput(key) {
|
||||||
this.value = (this.value + key).slice(0, 6);
|
this.value = (this.value + key).slice(0, 6);
|
||||||
|
@ -91,7 +91,6 @@ export default {
|
|||||||
placeholder="Choose City"
|
placeholder="Choose City"
|
||||||
@click="showPicker = true"
|
@click="showPicker = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-popup v-model="showPicker" position="bottom">
|
<van-popup v-model="showPicker" position="bottom">
|
||||||
<van-picker
|
<van-picker
|
||||||
show-toolbar
|
show-toolbar
|
||||||
|
@ -97,7 +97,6 @@ export default {
|
|||||||
placeholder="选择城市"
|
placeholder="选择城市"
|
||||||
@click="showPicker = true"
|
@click="showPicker = true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-popup v-model="showPicker" position="bottom">
|
<van-popup v-model="showPicker" position="bottom">
|
||||||
<van-picker
|
<van-picker
|
||||||
show-toolbar
|
show-toolbar
|
||||||
|
@ -15,7 +15,6 @@ Vue.use(Popup);
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell is-link @click="showPopup">Show Popup</van-cell>
|
<van-cell is-link @click="showPopup">Show Popup</van-cell>
|
||||||
|
|
||||||
<van-popup v-model="show">Content</van-popup>
|
<van-popup v-model="show">Content</van-popup>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -56,7 +55,6 @@ Use `position` prop to set popup display position
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '20%' }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Custom Icon -->
|
<!-- Custom Icon -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="show"
|
v-model="show"
|
||||||
@ -65,7 +63,6 @@ Use `position` prop to set popup display position
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '20%' }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Icon Position -->
|
<!-- Icon Position -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="show"
|
v-model="show"
|
||||||
|
@ -21,7 +21,6 @@ Vue.use(Popup);
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-cell is-link @click="showPopup">展示弹出层</van-cell>
|
<van-cell is-link @click="showPopup">展示弹出层</van-cell>
|
||||||
|
|
||||||
<van-popup v-model="show">内容</van-popup>
|
<van-popup v-model="show">内容</van-popup>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -64,7 +63,6 @@ export default {
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '20%' }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 自定义图标 -->
|
<!-- 自定义图标 -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="show"
|
v-model="show"
|
||||||
@ -73,7 +71,6 @@ export default {
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
:style="{ height: '20%' }"
|
:style="{ height: '20%' }"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 图标位置 -->
|
<!-- 图标位置 -->
|
||||||
<van-popup
|
<van-popup
|
||||||
v-model="show"
|
v-model="show"
|
||||||
|
@ -42,13 +42,11 @@ Use `pivot-text` to custom text,use `color` to custom bar color
|
|||||||
color="#f2826a"
|
color="#f2826a"
|
||||||
:percentage="25"
|
:percentage="25"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-progress
|
<van-progress
|
||||||
pivot-text="Red"
|
pivot-text="Red"
|
||||||
color="#ee0a24"
|
color="#ee0a24"
|
||||||
:percentage="50"
|
:percentage="50"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-progress
|
<van-progress
|
||||||
:percentage="75"
|
:percentage="75"
|
||||||
pivot-text="Purple"
|
pivot-text="Purple"
|
||||||
|
@ -45,13 +45,11 @@ Vue.use(Progress);
|
|||||||
color="#f2826a"
|
color="#f2826a"
|
||||||
:percentage="25"
|
:percentage="25"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-progress
|
<van-progress
|
||||||
pivot-text="红色"
|
pivot-text="红色"
|
||||||
color="#ee0a24"
|
color="#ee0a24"
|
||||||
:percentage="50"
|
:percentage="50"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-progress
|
<van-progress
|
||||||
:percentage="75"
|
:percentage="75"
|
||||||
pivot-text="紫色"
|
pivot-text="紫色"
|
||||||
|
@ -65,17 +65,23 @@ export default {
|
|||||||
### Custom button
|
### Custom button
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-slider
|
<van-slider v-model="value" active-color="#ee0a24">
|
||||||
v-model="value"
|
<div slot="button" class="custom-button">
|
||||||
active-color="#ee0a24"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
slot="button"
|
|
||||||
class="custom-button"
|
|
||||||
>
|
|
||||||
{{ value }}
|
{{ value }}
|
||||||
</div>
|
</div>
|
||||||
</van-slider>
|
</van-slider>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.custom-button {
|
||||||
|
width: 26px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ee0a24;
|
||||||
|
border-radius: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Vertical
|
### Vertical
|
||||||
|
@ -65,17 +65,23 @@ export default {
|
|||||||
### 自定义按钮
|
### 自定义按钮
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-slider
|
<van-slider v-model="value" active-color="#ee0a24">
|
||||||
v-model="value"
|
<div slot="button" class="custom-button">
|
||||||
active-color="#ee0a24"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
slot="button"
|
|
||||||
class="custom-button"
|
|
||||||
>
|
|
||||||
{{ value }}
|
{{ value }}
|
||||||
</div>
|
</div>
|
||||||
</van-slider>
|
</van-slider>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.custom-button {
|
||||||
|
width: 26px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #ee0a24;
|
||||||
|
border-radius: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
```
|
```
|
||||||
|
|
||||||
### 垂直方向
|
### 垂直方向
|
||||||
|
@ -64,7 +64,6 @@ export default {
|
|||||||
checked: true
|
checked: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(checked) {
|
onInput(checked) {
|
||||||
Dialog.confirm({
|
Dialog.confirm({
|
||||||
|
@ -76,7 +76,6 @@ export default {
|
|||||||
checked: true
|
checked: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onInput(checked) {
|
onInput(checked) {
|
||||||
Dialog.confirm({
|
Dialog.confirm({
|
||||||
|
@ -143,18 +143,10 @@ export default {
|
|||||||
<router-view />
|
<router-view />
|
||||||
|
|
||||||
<van-tabbar route>
|
<van-tabbar route>
|
||||||
<van-tabbar-item
|
<van-tabbar-item replace to="/home" icon="home-o">
|
||||||
replace
|
|
||||||
to="/home"
|
|
||||||
icon="home-o"
|
|
||||||
>
|
|
||||||
Tab
|
Tab
|
||||||
</van-tabbar-item>
|
</van-tabbar-item>
|
||||||
<van-tabbar-item
|
<van-tabbar-item replace to="/search" icon="search">
|
||||||
replace
|
|
||||||
to="/search"
|
|
||||||
icon="search"
|
|
||||||
>
|
|
||||||
Tab
|
Tab
|
||||||
</van-tabbar-item>
|
</van-tabbar-item>
|
||||||
</van-tabbar>
|
</van-tabbar>
|
||||||
|
@ -150,18 +150,10 @@ export default {
|
|||||||
<router-view />
|
<router-view />
|
||||||
|
|
||||||
<van-tabbar route>
|
<van-tabbar route>
|
||||||
<van-tabbar-item
|
<van-tabbar-item replace to="/home" icon="home-o">
|
||||||
replace
|
|
||||||
to="/home"
|
|
||||||
icon="home-o"
|
|
||||||
>
|
|
||||||
标签
|
标签
|
||||||
</van-tabbar-item>
|
</van-tabbar-item>
|
||||||
<van-tabbar-item
|
<van-tabbar-item replace to="/search" icon="search">
|
||||||
replace
|
|
||||||
to="/search"
|
|
||||||
icon="search"
|
|
||||||
>
|
|
||||||
标签
|
标签
|
||||||
</van-tabbar-item>
|
</van-tabbar-item>
|
||||||
</van-tabbar>
|
</van-tabbar>
|
||||||
|
@ -61,11 +61,11 @@ export default {
|
|||||||
<van-tree-select
|
<van-tree-select
|
||||||
height="55vw"
|
height="55vw"
|
||||||
:items="items"
|
:items="items"
|
||||||
:main-active-index.sync="activeIndex"
|
:main-active-index.sync="active"
|
||||||
>
|
>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<van-image v-if="activeIndex === 0" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
|
<van-image v-if="active === 0" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
|
||||||
<van-image v-if="activeIndex === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
|
<van-image v-if="active === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
|
||||||
</template>
|
</template>
|
||||||
</van-tree-select>
|
</van-tree-select>
|
||||||
```
|
```
|
||||||
@ -74,7 +74,7 @@ export default {
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeIndex: 0,
|
active: 0,
|
||||||
items: [{ text: 'Group 1' }, { text: 'Group 2' }]
|
items: [{ text: 'Group 1' }, { text: 'Group 2' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,11 +67,11 @@ export default {
|
|||||||
<van-tree-select
|
<van-tree-select
|
||||||
height="55vw"
|
height="55vw"
|
||||||
:items="items"
|
:items="items"
|
||||||
:main-active-index.sync="activeIndex"
|
:main-active-index.sync="active"
|
||||||
>
|
>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<van-image v-if="activeIndex === 0" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
|
<van-image v-if="active === 0" src="https://img.yzcdn.cn/vant/apple-1.jpg" />
|
||||||
<van-image v-if="activeIndex === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
|
<van-image v-if="active === 1" src="https://img.yzcdn.cn/vant/apple-2.jpg" />
|
||||||
</template>
|
</template>
|
||||||
</van-tree-select>
|
</van-tree-select>
|
||||||
```
|
```
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeIndex: 0,
|
active: 0,
|
||||||
items: [{ text: '分组 1' }, { text: '分组 2' }]
|
items: [{ text: '分组 1' }, { text: '分组 2' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,6 @@ export default {
|
|||||||
Toast('Please upload an image in jpg format');
|
Toast('Please upload an image in jpg format');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
asyncBeforeRead(file) {
|
asyncBeforeRead(file) {
|
||||||
|
@ -104,7 +104,6 @@ export default {
|
|||||||
Toast('请上传 jpg 格式图片');
|
Toast('请上传 jpg 格式图片');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
// 返回 Promise
|
// 返回 Promise
|
||||||
|
Loading…
x
Reference in New Issue
Block a user