Skip to content

Commit

Permalink
修复弹窗关闭时控制台报错 #28
Browse files Browse the repository at this point in the history
  • Loading branch information
syh19 committed Jul 1, 2024
1 parent cba4b07 commit eb8cae5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
14 changes: 9 additions & 5 deletions src/components/AddHandleDate.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<template>
<div class="plugin-task-list__add-handle-date-dialog-wrap">
<el-dialog
v-model="visible"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-model="dialogVisible"
show-close
close-on-click-modal
close-on-press-escape
:title="i18n.addHandleDate"
width="500"
@close="close"
>
<div>
<DatePicker
Expand Down Expand Up @@ -51,9 +52,12 @@ const props = withDefaults(defineProps<Props>(), {
taskId: '',
})
const dialogVisible = ref<boolean>(false)
watch(
() => props.visible,
(val) => {
dialogVisible.value = val
if (val) {
init()
}
Expand Down Expand Up @@ -107,7 +111,7 @@ const close = () => {
emit('close')
}
const submit = async () => {
emit('close')
close()
let handleData: string = date.formatHandleDateToStorage({
dateParam: handleDate.value,
})
Expand Down
12 changes: 8 additions & 4 deletions src/components/TaskFilter.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<template>
<el-dialog
v-model="visible"
:show-close="false"
:close-on-click-modal="false"
:close-on-press-escape="false"
v-model="dialogVisible"
show-close
close-on-click-modal
close-on-press-escape
class="plugin-task-list__task-filter-dialog-wrap"
:title="i18n.filterConfig.title"
width="700"
@close="close"
>
<!-- 是否显示周视图 -->
<div class="setting-item setting-item__horizontal">
Expand Down Expand Up @@ -172,6 +173,8 @@ const props = withDefaults(defineProps<Props>(), {
taskId: '',
})
const dialogVisible = ref<boolean>(false)
const datePickerPopover = ref<any>({
visibility: 'click',
placement: 'right',
Expand All @@ -192,6 +195,7 @@ const init = () => {
watch(
() => props.visible,
(val) => {
dialogVisible.value = val
if (val) {
init()
}
Expand Down

0 comments on commit eb8cae5

Please sign in to comment.