From 225c0088e121d62cabf500e23f9cd11e05bcf8c1 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 24 Dec 2024 17:08:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E9=87=8D=E6=9E=84=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E6=90=9C=E7=B4=A2=E7=BB=84=E4=BB=B6=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重构 AiPullDown 组件,使用 v-model 实现双向绑定 - 优化 AiSearchBar 组件样式和布局 - 调整 AiPage 组件中的滚动条样式 --- ui/packages/basic/AiPullDown.vue | 31 +++++++++++++++----------- ui/packages/layout/AiPage.vue | 13 ++++++----- ui/packages/layout/AiSearchBar.vue | 35 ++++++++++++++++++++---------- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/ui/packages/basic/AiPullDown.vue b/ui/packages/basic/AiPullDown.vue index c8a089a3..ec5d11af 100644 --- a/ui/packages/basic/AiPullDown.vue +++ b/ui/packages/basic/AiPullDown.vue @@ -14,8 +14,11 @@ export default { name: "AiPullDown", props: { - target: String, - height: {default: 4}, + value: Boolean, + }, + model: { + prop: 'value', + event: 'expand' }, data() { return { @@ -25,32 +28,34 @@ export default { methods: { handleExpand() { this.expand = !this.expand - if (this.target) { - - } else this.$emit('change', this.expandStyle) } }, computed: { btnText() { - return this.expand ? '收起高级搜索' : '展开高级搜索' - }, - expandStyle() { - let initStyle = {overflow: 'hidden', height: `${this.height}px`} - this.expand && (initStyle.height = "auto") - return initStyle + return this.expand ? '收起' : '展开' }, expandIcon() { return this.expand ? 'iconfont iconDouble_Up' : 'iconfont iconDouble_Down' } }, - mounted() { - this.$emit("change", this.expandStyle) + watch: { + expand: { + immediate: true, handler(v) { + this.$emit('expand', v) + } + } } }