fix: 处理 model 报错

This commit is contained in:
奔跑的面条
2023-01-08 19:20:44 +08:00
parent 7b262c9db2
commit 45cadcecc3
6 changed files with 44 additions and 15 deletions
@@ -1,5 +1,5 @@
<template>
<n-modal v-model:show="modelShow" :mask-closable="true" @afterLeave="closeHandle">
<n-modal v-model:show="modelShowRef" :mask-closable="true" @afterLeave="closeHandle">
<n-table class="model-content" :bordered="false" :single-line="false">
<thead>
<tr>
@@ -31,17 +31,24 @@
</template>
<script setup lang="ts">
import { watch, ref } from 'vue'
import { icon } from '@/plugins'
import { WinKeyboard, MacKeyboard } from '@/enums/editPageEnum'
const { CloseIcon } = icon.ionicons5
const modelShowRef = ref(false)
const emit = defineEmits(['update:modelShow'])
defineProps({
const props = defineProps({
modelShow: Boolean
})
watch(() => props.modelShow, (newValue) => {
modelShowRef.value = newValue
})
// 快捷键
const shortcutKeyOptions = [
{
@@ -121,6 +128,7 @@ const shortcutKeyOptions = [
mac: `${MacKeyboard.CTRL_SOURCE_KEY.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + G `
}
]
const closeHandle = () => {
emit('update:modelShow', false)
}