refactor(components): [el-message] change the name of stopTimer

Co-authored-by: iceman <dd>
This commit is contained in:
iceman 2021-10-26 11:04:36 +08:00 committed by GitHub
parent 4e99d0b5ba
commit 65a29f2a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ export default defineComponent({
setup(props) {
const visible = ref(false)
let timer: (() => void) | undefined = undefined
let stopTimer: (() => void) | undefined = undefined
const typeClass = computed(() =>
props.iconClass ? props.iconClass : typeMap[props.type] ?? ''
@ -74,14 +74,14 @@ export default defineComponent({
function startTimer() {
if (props.duration > 0) {
;({ stop: timer } = useTimeoutFn(() => {
;({ stop: stopTimer } = useTimeoutFn(() => {
if (visible.value) close()
}, props.duration))
}
}
function clearTimer() {
timer?.()
stopTimer?.()
}
function close() {