From a2bcc81db57897055d036480506067590c54317d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Thu, 13 Oct 2022 17:00:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(component):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20tansfer=20=E7=BB=84=E4=BB=B6=20data-source=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=BC=BA=E5=B0=91=E5=93=8D=E5=BA=94=E5=BC=8F=E7=9A=84?= =?UTF-8?q?=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/transfer/index.vue | 6 +++--- package/component/src/component/upload/index.vue | 6 +++--- .../src/document/zh-CN/components/transfer.md | 2 +- .../src/document/zh-CN/guide/changelog.md | 12 ++++++++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/package/component/src/component/transfer/index.vue b/package/component/src/component/transfer/index.vue index 42e3a408..9642bb3e 100644 --- a/package/component/src/component/transfer/index.vue +++ b/package/component/src/component/transfer/index.vue @@ -37,9 +37,9 @@ const props = withDefaults(defineProps(), { const emits = defineEmits(["update:modelValue", "change"]); -const leftDataSource: Ref = ref([...props.dataSource]); +const leftDataSource: Ref = ref([]); const rightDataSource: Ref = ref([]); -const _leftDataSource: Ref = ref([...props.dataSource]); +const _leftDataSource: Ref = ref([]); const _rightDataSource: Ref = ref([]); const leftSelectedKeys: Ref = ref([]); const rightSelectedKeys: Ref = ref([]); @@ -63,7 +63,7 @@ const allLeftChange = (isChecked: boolean) => { }; watch( - () => props.modelValue, + () => [props.modelValue, props.dataSource], () => { let targetDataSource: any[] = []; diff --git a/package/component/src/component/upload/index.vue b/package/component/src/component/upload/index.vue index 0766af71..16054629 100644 --- a/package/component/src/component/upload/index.vue +++ b/package/component/src/component/upload/index.vue @@ -263,7 +263,7 @@ const filetoDataURL = (file: File, fn: Function) => { reader.readAsDataURL(file); }; -const getUploadChange = (e: any) => { +const uploadChange = (e: any) => { const files = e.target.files; const _files = [...files]; if (props.multiple && props.number != 0 && props.number < _files.length) { @@ -363,7 +363,7 @@ onMounted(() => { nextTick(() => { dragRef.value.addEventListener("dragenter",dragEnter,false); dragRef.value.addEventListener("dragover",dragOver,false); - dragRef.value.addEventListener("drop",getUploadChange,false); + dragRef.value.addEventListener("drop",uploadChange,false); }) }) @@ -383,7 +383,7 @@ onMounted(() => { :accept="acceptMime" :disabled="disabled" @click="clickOrgInput" - @change="getUploadChange" + @change="uploadChange" />
diff --git a/package/document-component/src/document/zh-CN/components/transfer.md b/package/document-component/src/document/zh-CN/components/transfer.md index f2d95663..b09958c9 100644 --- a/package/document-component/src/document/zh-CN/components/transfer.md +++ b/package/document-component/src/document/zh-CN/components/transfer.md @@ -23,7 +23,7 @@ export default { setup() { const value1 = ref(['1']); - const dataSource1 = [{id:'1', title:'易大师', disabled: true},{id:'2', title:'战争之王'}] + const dataSource1 = ref([{id:'1', title:'易大师', disabled: true},{id:'2', title:'战争之王'}]) return { value1, diff --git a/package/document-component/src/document/zh-CN/guide/changelog.md b/package/document-component/src/document/zh-CN/guide/changelog.md index b9635f25..859d34b3 100644 --- a/package/document-component/src/document/zh-CN/guide/changelog.md +++ b/package/document-component/src/document/zh-CN/guide/changelog.md @@ -11,6 +11,18 @@