From f70dc8d74ebc9f2a13191fad3482723583a55bd8 Mon Sep 17 00:00:00 2001
From: zhaojinfeng <121016171@qq.com>
Date: Wed, 6 Sep 2023 20:03:30 +0800
Subject: [PATCH] =?UTF-8?q?perf:=20=E5=90=88=E5=B9=B6=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/select-transfer-modal/index.vue | 12 ++++--------
stories/SelectTransferModal.stories.ts | 11 +++++++----
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/packages/select-transfer-modal/index.vue b/packages/select-transfer-modal/index.vue
index ca46fc7..2eec6db 100644
--- a/packages/select-transfer-modal/index.vue
+++ b/packages/select-transfer-modal/index.vue
@@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-08-14 11:07:15
* @LastEditors: zhaojinfeng 121016171@qq.com
- * @LastEditTime: 2023-09-05 18:26:31
+ * @LastEditTime: 2023-09-06 20:03:04
* @FilePath: \vue3\packages\select-transfer-modal\index.vue
* @Description:
*
@@ -19,9 +19,8 @@
:z-index="zIndex" @open="getList" @closed="closed"
>
-
-
- {{ queryParams }}
+
+
@@ -148,8 +147,6 @@ const queryParams = reactive({
pageSize: properties.pageSizes[0] || 10,
})
-const leftParams = reactive({})
-
const data = computed(() => {
const all: any[] = []
const { props: { disabled = 'disabled', key = 'id' }, lockList } = properties
@@ -180,7 +177,6 @@ async function getList() {
try {
const response = await properties.request({
...properties.defaultParams,
- ...leftParams, // 合并参数
...queryParams,
})
const { key = 'id' } = properties.props
@@ -241,7 +237,7 @@ function transferValueInit() {
transferValueInit()
-watch(() => leftParams, handleQuery)
+watch(() => properties.defaultParams, handleQuery, { deep: true })
watch(() => properties.value, transferValueInit)
watch(() => properties.show, (show) => {
showDialog.value = show
diff --git a/stories/SelectTransferModal.stories.ts b/stories/SelectTransferModal.stories.ts
index 3aad97f..eaaafa9 100644
--- a/stories/SelectTransferModal.stories.ts
+++ b/stories/SelectTransferModal.stories.ts
@@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-08-14 11:07:15
* @LastEditors: zhaojinfeng 121016171@qq.com
- * @LastEditTime: 2023-09-05 18:19:09
+ * @LastEditTime: 2023-09-06 20:02:01
* @FilePath: \vue3\stories\SelectTransferModal.stories.ts
* @Description:
*
@@ -168,6 +168,10 @@ export const LeftSlot: Story = {
name: '左插槽',
args: {
...meta.args,
+ width: '90%',
+ defaultParams: {
+ name: '',
+ },
},
render: args => ({
components: { ThSelectTransferModal },
@@ -189,10 +193,9 @@ export const LeftSlot: Story = {
:width="args.width"
:z-index="args.zIndex"
>
-
+
-
-
+