Skip to content

Commit

Permalink
feat(shortUrl): ts 类型错误
Browse files Browse the repository at this point in the history
  • Loading branch information
vaebe committed May 17, 2024
1 parent 03dd106 commit 6fd7b84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/ShortUrlForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const userStore = useUserStore()
const { isLogin } = storeToRefs(userStore)
// 禁用今日之前的日期
function isDateBeforeToday(time) {
function isDateBeforeToday(time: Date) {
return time.getTime() < new Date(new Date().toDateString()).getTime()
}
Expand Down Expand Up @@ -56,7 +56,7 @@ function getData() {
function resetData() {
Object.keys(info).forEach((item) => {
info[item] = defaultData[item]
info[item as keyof DefaultDataType] = defaultData[item as keyof DefaultDataType]
})
}
Expand Down
4 changes: 3 additions & 1 deletion src/views/dataManagement/shortUrl/components/AddDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ function create() {
function openDialog() {
dialogVisible.value = true
}
function dialogOpened() {
nextTick(() => {
shortUrlFormRef.value.resetData()
})
Expand All @@ -36,7 +38,7 @@ defineExpose({
</script>

<template>
<el-dialog v-model="dialogVisible" title="创建短链" width="680px">
<el-dialog v-model="dialogVisible" title="创建短链" width="680px" @opened="dialogOpened">
<ShortUrlForm ref="shortUrlFormRef" />
<template #footer>
<div class="flex justify-center">
Expand Down

0 comments on commit 6fd7b84

Please sign in to comment.