From 1b44822a82af06aeda4cdfce1642d391eb9e7394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 14:08:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(Modal):=20=E4=BF=AE=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=88=A0=E9=99=A4=E7=82=B9=E5=87=BB=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=85=B3=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-modal.vue/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/u-modal.vue/index.vue b/src/components/u-modal.vue/index.vue index fe2b4048d..2e7cf15f3 100644 --- a/src/components/u-modal.vue/index.vue +++ b/src/components/u-modal.vue/index.vue @@ -9,7 +9,7 @@ leave-active-class="animate__animated animate__fadeOutUpSmall animate__fast">
+ :style="{ width: width + 'px' }" :size="size" @click.stop="noop">
@@ -184,6 +184,8 @@ export const UModal = { if (this.maskClose && !this.$refs.dialog.contains(e.target)) this.close(); }, + noop() { // 因为dialog 直接用overlay 套了实际额内容,导致只能stop 方式阻止事件冒泡.... + }, }, install(Vue, id) { const Ctor = Vue.component(id); From cf9189375195c0521677557229ba973056ffcd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 15:29:33 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(FormItem):=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E5=8D=A0=E6=BB=A1=E6=83=85=E5=86=B5=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=A1=AB=E5=85=85=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-form.vue/item.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/u-form.vue/item.vue b/src/components/u-form.vue/item.vue index b3f8e2eca..5dc8d287f 100644 --- a/src/components/u-form.vue/item.vue +++ b/src/components/u-form.vue/item.vue @@ -279,10 +279,23 @@ export default { .root[layout="block"] > .field { vertical-align: top; } -.root[layout="center"]{ +.root[layout="center"] { display: flex; align-items: center; } + +.root[layout="center"] .label { + flex-shrink: 0; +} + +.root[layout="center"] .field { + flex: 1; +} + +.root[layout="center"] .wrap { + width: 100%; +} + .root[layout="end"]{ display: flex; align-items: flex-end; From 87bc7dac5ca638b0b36159d73b7b8308b97beb6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 15:31:35 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(DatePicker):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-date-picker.vue/index.vue | 1 + src/components/u-date-picker.vue/range.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/u-date-picker.vue/index.vue b/src/components/u-date-picker.vue/index.vue index 600b32485..7a8cb1eae 100644 --- a/src/components/u-date-picker.vue/index.vue +++ b/src/components/u-date-picker.vue/index.vue @@ -377,6 +377,7 @@ export default { .root { display: inline-block; position: relative; + max-width: 100%; /* 防止表格等小的地方超出区域 */ width: var(--datepicker-input-width); } diff --git a/src/components/u-date-picker.vue/range.vue b/src/components/u-date-picker.vue/range.vue index c74d5f0be..9ab05812f 100644 --- a/src/components/u-date-picker.vue/range.vue +++ b/src/components/u-date-picker.vue/range.vue @@ -412,6 +412,7 @@ export default { .root { display: inline-block; position: relative; + max-width: 100%; /* 防止表格等小的地方超出区域 */ width: var(--datepicker-range-input-width); } From 7d59941daa0dbc39486fbf3fd69ea3ebbc7b52ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 17:24:18 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix(Tabs):=20=E4=BF=AE=E5=A4=8Dtabs=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6v-if=20=E8=AE=BE=E7=BD=AE=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=97=B6=EF=BC=8C=E9=A1=BA=E8=AE=AF=E9=94=99?= =?UTF-8?q?=E4=B9=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/m-parent.vue/m-child.vue | 24 +++++- .../__tests__/__snapshots__/demo.test.js.snap | 74 +++++++++++++++++++ src/components/u-tabs.vue/docs/cases.md | 43 +++++++++++ 3 files changed, 138 insertions(+), 3 deletions(-) diff --git a/src/components/m-parent.vue/m-child.vue b/src/components/m-parent.vue/m-child.vue index baae21a7c..dea23e856 100644 --- a/src/components/m-parent.vue/m-child.vue +++ b/src/components/m-parent.vue/m-child.vue @@ -45,11 +45,29 @@ export default { return; } - const index = parentVM.$slots.default ? parentVM.$slots.default.indexOf(this.$vnode) : -1; - if (~index) + if (!parentVM.$slots.default || !parentVM.$slots.default.length) { + parentVM.itemVMs.push(this); + return; + } + + const defaultSlots = parentVM.$slots.default; + const currentSlotIndex = defaultSlots.indexOf(this.$vnode); + if (currentSlotIndex === -1) { + parentVM.itemVMs.push(this); + return; + } + + // 根据 slot.default 位置,进行插入 + const index = parentVM.itemVMs.findIndex((itemVM) => { + const slotIndex = defaultSlots.indexOf(itemVM.$vnode); + return slotIndex > currentSlotIndex; + }); + + if (index !== -1) { parentVM.itemVMs.splice(index, 0, this); - else + } else { parentVM.itemVMs.push(this); + } }); !this.groupVM && this.$contact(this.$options.groupName, (groupVM) => { diff --git a/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap b/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap index ebff34765..89e66751a 100644 --- a/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap +++ b/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap @@ -1782,6 +1782,80 @@ exports[`u-tabs.vue Demo-路由 1`] = `
`; +exports[`u-tabs.vue Demo-随机添加测试 1`] = ` +
+
+ + +
+
+ + + + + + + +
逻辑内容 +
+
+
+`; + exports[`u-tabs.vue Demo-默认显示和可关闭 1`] = `
diff --git a/src/components/u-tabs.vue/docs/cases.md b/src/components/u-tabs.vue/docs/cases.md index f0449404d..0110bf223 100644 --- a/src/components/u-tabs.vue/docs/cases.md +++ b/src/components/u-tabs.vue/docs/cases.md @@ -1,3 +1,46 @@ +### 随机添加测试 +```vue + + +``` + ### 形态 #### text From 9f739d89b979583ba00b95562785d0942575a317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 17:53:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix(Select):=20=E4=BF=AE=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=A1=86=E5=8D=95=E9=80=89=E6=90=9C=E7=B4=A2=E4=BC=9A?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E8=BE=93=E5=85=A5=E6=A1=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-select.vue/index.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/u-select.vue/index.vue b/src/components/u-select.vue/index.vue index 8f7c9757e..72dd29039 100644 --- a/src/components/u-select.vue/index.vue +++ b/src/components/u-select.vue/index.vue @@ -319,12 +319,18 @@ export default { }, created() { this.$watch('selectedVM', (selectedVM, oldVM) => { - if (selectedVM && oldVM && selectedVM.currentText === oldVM.currentText) + if (selectedVM && oldVM && selectedVM.currentText === oldVM.currentText) { return; - if (this.filterable) - this.filterText = this.selectedVM ? this.selectedVM.currentText : ''; - else + } + if (this.filterable) { + if (this.selectedVM) { + this.filterText = this.selectedVM.currentText; + } + // blur 事件会处理这个未搜索到置空的问题 + // this.filterText = ? this.selectedVM.currentText : ''; + } else { this.currentText = this.selectedVM ? this.selectedVM.currentText : ''; + } }); this.$watch('selectedVMs', (selectedVMs) => { this.currentText = selectedVMs From 0a2e47011c1835d837844c69c2d8c92cc38ff2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=AE=87=E9=98=B3?= Date: Thu, 1 Feb 2024 18:55:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B=EF=BC=8C=E5=8A=A0=E5=BF=AB=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__tests__/__snapshots__/demo.test.js.snap | 22 +++++++++++--- src/components/u-tabs.vue/docs/cases.md | 30 +++++++++++-------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap b/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap index 89e66751a..1297a9b61 100644 --- a/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap +++ b/src/components/u-tabs.vue/__tests__/__snapshots__/demo.test.js.snap @@ -1790,7 +1790,7 @@ exports[`u-tabs.vue Demo-随机添加测试 1`] = `
- diff --git a/src/components/u-tabs.vue/docs/cases.md b/src/components/u-tabs.vue/docs/cases.md index 0110bf223..a9daa1db9 100644 --- a/src/components/u-tabs.vue/docs/cases.md +++ b/src/components/u-tabs.vue/docs/cases.md @@ -1,17 +1,17 @@ ### 随机添加测试 ```vue