|
3 | 3 | <view class="u-demo-wrap" style="background-color: #FFFFFF;">
|
4 | 4 | <view class="u-demo-title">演示效果</view>
|
5 | 5 | <view class="u-demo-area">
|
6 |
| - <u-calendar isFixed :minDate="minDate" :maxDate="maxDate" :btnType="btnType" :activeBgColor="activeBgColor" |
| 6 | + <u-calendar v-model="show" :minDate="minDate" :maxDate="maxDate" :btnType="btnType" :activeBgColor="activeBgColor" |
7 | 7 | :rangeBgColor="rangeBgColor" :rangeColor="rangeColor" :startText="startText" :endText="endText" :arrowType="arrowType"
|
8 |
| - :type="type" ref="calendar" @change="change"></-calendar> |
| 8 | + :mode="mode" ref="calendar" @change="change"> |
| 9 | + |
| 10 | + </u-calendar> |
9 | 11 | </view>
|
10 | 12 | </view>
|
11 | 13 | <view class="u-config-wrap">
|
12 | 14 | <view class="u-config-title u-border-bottom">
|
13 | 15 | 参数配置
|
14 | 16 | </view>
|
15 | 17 | <view class="u-config-item">
|
16 |
| - <view class="u-item-title">右侧按钮</view> |
17 |
| - <u-subsection vibrateShort current="1" :list="['是', '否']" @change="showBtnChange"></u-subsection> |
| 18 | + <view class="u-item-title">状态</view> |
| 19 | + <u-subsection vibrateShort :current="showBtnStatus" :list="['显示', '隐藏']" @change="showChange"></u-subsection> |
18 | 20 | </view>
|
19 | 21 | <view class="u-config-item">
|
20 | 22 | <view class="u-item-title">显示错误信息</view>
|
|
40 | 42 | export default {
|
41 | 43 | data() {
|
42 | 44 | return {
|
43 |
| - type: 1, |
44 |
| - status: [], |
| 45 | + show: true, |
| 46 | + mode: 'range', |
45 | 47 | arrowType: 1,
|
46 | 48 | minDate: "1920-01-01",
|
47 | 49 | maxDate: "",
|
48 | 50 | btnType: "primary",
|
49 |
| - activeBgColor: "#5677fc", |
50 |
| - rangeBgColor: "rgba(86,119,252,0.1)", |
51 |
| - rangeColor: "#5677fc", |
| 51 | + activeBgColor: "#2979ff", |
| 52 | + rangeBgColor: "rgba(41,121,255,0.13)", |
| 53 | + rangeColor: "#2979ff", |
52 | 54 | startText: "开始",
|
53 | 55 | endText: "结束",
|
54 | 56 | result: ""
|
55 | 57 | }
|
56 | 58 | },
|
| 59 | + computed: { |
| 60 | + showBtnStatus() { |
| 61 | + return this.show ? 0 : 1; |
| 62 | + } |
| 63 | + }, |
57 | 64 | methods: {
|
58 |
| - showBtnChange(index) { |
59 |
| - this.showBtn = index == 0 ? true : false; |
| 65 | + showChange(index) { |
| 66 | + this.show = !index; |
60 | 67 | },
|
61 | 68 | errorMessageChange(index) {
|
62 | 69 | this.errorMessage = index == 0 ? '手机号有误' : false
|
|
77 | 84 | },
|
78 | 85 | textareaChange(index) {
|
79 | 86 | this.type = index == 0 ? 'textarea' : 'text';
|
| 87 | + }, |
| 88 | + change(e) { |
| 89 | + console.log(e) |
| 90 | + if (this.type == 1) { |
| 91 | + this.result = e.result |
| 92 | + } else { |
| 93 | + this.result = `${e.startDate} 至 ${e.endDate}` |
| 94 | + } |
80 | 95 | }
|
81 | 96 | }
|
82 | 97 | }
|
|
0 commit comments