mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
refactor(components): [el-message] change the name of stopTimer
Co-authored-by: iceman <dd>
This commit is contained in:
parent
4e99d0b5ba
commit
65a29f2a2b
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user