fix: 处理 i18n 报错和 props 报错

This commit is contained in:
奔跑的面条
2023-01-08 19:10:41 +08:00
parent 4e091c7f49
commit 7b262c9db2
9 changed files with 43 additions and 26 deletions
@@ -2,7 +2,7 @@
<!-- mask-closable 暂时是失效的不知道为啥 -->
<n-modal
class="go-modal-box"
v-model:show="modalShow"
v-model:show="showRef"
@afterLeave="closeHandle"
>
<n-card hoverable size="small">
@@ -75,20 +75,36 @@
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import { ref, reactive, watch } from 'vue'
import { renderIcon, renderLang } from '@/utils'
import { icon } from '@/plugins'
import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn'
const { HammerIcon } = icon.ionicons5
const showRef = ref(false)
const emit = defineEmits(['close', 'edit'])
const props = defineProps({
modalShow: Boolean,
cardData: Object
modalShow: {
required: true,
type: Boolean
},
cardData: {
required: true,
type: Object
}
})
watch(
() => props.modalShow,
newValue => {
showRef.value = newValue
},
{
immediate: true
}
)
// 处理url获取
const requireUrl = (name: string) => {
return new URL(`../../../../../assets/images/${name}`, import.meta.url).href