chore: rebuild docs

This commit is contained in:
jiangruowei
2017-03-22 17:10:01 +08:00
parent befabdcad1
commit f7be36edcb
8 changed files with 102 additions and 7 deletions

View File

@@ -4,6 +4,11 @@
<zan-cell title="单元格2" value="单元格2内容"></zan-cell>
</zan-cell-group>
</example-block><example-block title="带*号,标明必填">
<zan-cell-group>
<zan-cell title="单元格1" required></zan-cell>
</zan-cell-group>
</example-block><example-block title="标题带描述信息">
<zan-cell-group>
<zan-cell title="单元格1" label="描述信息" is-link="" url="javascript:void(0)" @click="handleClick"></zan-cell>

View File

@@ -0,0 +1,33 @@
<template><section class="demo-datetime-picker"><h1 class="demo-title">datetime-picker</h1><example-block title="基础用法">
<zan-datetime-picker type="time" :min-hour="minHour" :max-hour="maxHour" :min-date="minDate" @change="handlePickerChange">
</zan-datetime-picker>
</example-block></section></template>
<script>
import Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock);
export default {
data() {
return {
minHour: 10,
maxHour: 20,
minDate: new Date()
};
},
methods: {
handlePickerChange(picker, values) {
// picker.setColumnValues(1, citys[values[0]]);
console.log(values);
},
handlePickerCancel() {
alert('picker cancel');
},
handlePickerConfirm() {
alert('picker confirm');
}
}
};
</script>

View File

@@ -1,8 +1,8 @@
<template><section class="demo-field"><h1 class="demo-title">field</h1><example-block title="基础用法">
<zan-cell-group>
<zan-field type="text" label="用户名:" placeholder="请输入用户名" v-model="username"></zan-field>
<zan-field type="password" label="密码:" placeholder="请输入密码"></zan-field>
<zan-field type="textarea" label="个人介绍:" placeholder="请输入个人介绍"></zan-field>
<zan-field type="text" label="用户名:" placeholder="请输入用户名" v-model="username" required></zan-field>
<zan-field type="password" label="密码:" placeholder="请输入密码" required></zan-field>
<zan-field type="textarea" label="个人介绍:" placeholder="请输入个人介绍" required></zan-field>
</zan-cell-group>
</example-block><example-block title="无label的输入框">
@@ -25,6 +25,11 @@
<zan-field label="用户名:" type="text" placeholder="请输入用户名" error=""></zan-field>
</zan-cell-group>
</example-block><example-block title="错误的输入框">
<zan-cell-group>
<zan-field label="留言:" type="textarea" placeholder="请输入留言" rows="1" autosize=""></zan-field>
</zan-cell-group>
</example-block></section></template>
<style>
@component-namespace demo {

View File

@@ -3,10 +3,22 @@
<zan-button @click="showLoadingToast">加载Toast</zan-button>
<zan-button @click="showSuccessToast">成功</zan-button>
<zan-button @click="showFailToast">失败</zan-button>
<zan-button @click="showForbidClickToast">背景不能点击</zan-button>
<zan-button @click="showCustomizedToast(5000)">倒数5秒</zan-button>
</example-block><example-block title="手动关闭">
<zan-button @click="showToast">打开</zan-button>
<zan-button @click="closeToast">关闭</zan-button>
</example-block><example-block title="手动关闭">
<zan-button @click="showHtmlToast">打开</zan-button>
</example-block></section></template>
<style>
@component-namespace demo {
@@ -35,6 +47,12 @@ export default {
showFailToast() {
Toast.fail('失败文案');
},
showForbidClickToast() {
Toast({
message: '背景不能点击',
forbidClick: true
})
},
showCustomizedToast(duration) {
let leftSec = duration / 1000;
let toast = Toast({
@@ -50,6 +68,18 @@ export default {
}
toast.message = (--leftSec).toString();
}, 1000);
},
showToast() {
this.toast = Toast('我是提示文案,建议不超过十五字~');
},
closeToast() {
this.toast.clear();
},
showHtmlToast() {
Toast({
type: 'html',
message: '<em>HTML<em>'
})
}
}
};