From 4b3497ac58ed7a255f5fff342a4dabeb2ad56931 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 23 Jan 2024 15:26:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/common-list/index.vue | 16 ++++++++++++++-- .../views/paragraph/component/ParagraphForm.vue | 2 +- ui/src/views/paragraph/index.vue | 7 ++++++- .../setting/component/CreateMemberDialog.vue | 4 ++-- ui/src/views/setting/index.vue | 11 +++++++---- 5 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ui/src/components/common-list/index.vue b/ui/src/components/common-list/index.vue index f9008facc..bbb07dfc7 100644 --- a/ui/src/components/common-list/index.vue +++ b/ui/src/components/common-list/index.vue @@ -22,15 +22,27 @@ import { ref, watch, useSlots } from 'vue' const slots = useSlots() defineOptions({ name: 'CommonList' }) -withDefaults( +const props = withDefaults( defineProps<{ data: Array + defaultActive: string }>(), { - data: () => [] + data: () => [], + defaultActive: '' } ) +watch( + () => props.defaultActive, + (val) => { + if (val) { + current.value = props.data.findIndex((v) => v.id === val) + } + }, + { immediate: true } +) + const emit = defineEmits(['click']) const current = ref(0) diff --git a/ui/src/views/paragraph/component/ParagraphForm.vue b/ui/src/views/paragraph/component/ParagraphForm.vue index 610c508f8..ec1837a63 100644 --- a/ui/src/views/paragraph/component/ParagraphForm.vue +++ b/ui/src/views/paragraph/component/ParagraphForm.vue @@ -22,7 +22,7 @@ type="textarea" > - {{ form.content }} + {{ form.content }} diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index ce481c1ec..48640d036 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -1,7 +1,12 @@