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 @@