Skip to content

Commit dd04774

Browse files
perf: Close editor save content
1 parent 7f6c528 commit dd04774

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ui/src/components/markdown/MdEditorMagnify.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</template>
2626

2727
<script setup lang="ts">
28-
import { ref, computed } from 'vue'
28+
import { ref, computed, watch } from 'vue'
2929
defineOptions({ name: 'MdEditorMagnify' })
3030
const props = defineProps<{
3131
title: String
@@ -40,8 +40,13 @@ const data = computed({
4040
return props.modelValue
4141
}
4242
})
43-
4443
const dialogVisible = ref(false)
44+
watch(dialogVisible, (bool) => {
45+
if (!bool) {
46+
emit('submitDialog', cloneContent.value)
47+
}
48+
})
49+
4550
const cloneContent = ref('')
4651
const footers: any = [null, '=', 0]
4752
function openDialog() {

0 commit comments

Comments
 (0)