替换v-model API 为 defineModel

This commit is contained in:
piexlmax(奇淼
2024-03-13 15:17:57 +08:00
parent 421304d4a3
commit e9100a9542
7 changed files with 201 additions and 208 deletions
+3 -7
View File
@@ -33,16 +33,12 @@ import Excel from '@/components/office/excel.vue'
const path = ref(import.meta.env.VITE_BASE_API)
const props = defineProps({
modelValue: {
type: String,
default: () => ''
}
})
const model = defineModel({ type: String})
const fileUrl = ref('')
const ext = ref('')
watch(
() => props.modelValue,
() => model,
val => {
fileUrl.value = val
const fileExt = val.split('.')[1] || ''