From 664d69fbe574bfaf3862d4804390e4b77df9fc19 Mon Sep 17 00:00:00 2001 From: Tevin <tingquanren@163.com> Date: Thu, 23 Sep 2021 17:32:27 +0800 Subject: [PATCH] 实现抽屉公共组件,代替TaroUI的抽屉 --- plugins/filter/CFilter.vue | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/filter/CFilter.vue b/plugins/filter/CFilter.vue index 80c1dac..ee5a95e 100644 --- a/plugins/filter/CFilter.vue +++ b/plugins/filter/CFilter.vue @@ -14,6 +14,7 @@ type="bar" :label="bar.label" :options="selectOptions[bar.name] || []" + :cancelable="bar.cancelable" :value="filterRes[bar.name]" :onChange="evt=>handleBarChange(bar.name, evt)" /> @@ -100,19 +101,22 @@ CFilterDateRange, }, props: { + filterData: { type: Object, default: () => {} }, // 筛选横条项目 - bar: { type: Object, default: {} }, + bar: { type: Object, default: () => {} }, // 筛选展开层项目列表 - items: { type: Array, default: [] }, + items: { type: Array, default: () => [] }, // 各个项目的选项列表 - selectOptions: { type: Object, default: {} }, + selectOptions: { type: Object, default: () => {} }, // 筛选变化时的回调 onChange: Function, }, data() { return { - filterRes: {}, + filterRes: this.filterData, + // 抽屉显示隐藏 drawerShow: false, + // 抽屉内容显示隐藏(抽屉展开动画完成后再渲染表单,否则出现动画卡顿) drawerDisplay: false, // 面板项有已选 itemsFilled: false, @@ -126,7 +130,7 @@ this.$nextTick(() => { setTimeout(() => { this.drawerDisplay = true; - }, 80); + }, 100); }); }, handleBarChange(name, value) { -- Gitblit v1.9.1