({ text, count, show, delayShow, countShow, callback, })
| 4536 | return; |
| 4537 | } |
| 4538 | function Tip({ text, count, show, delayShow, countShow, callback, }) { |
| 4539 | return createElementNode('div', undefined, { |
| 4540 | class: watchRef([show, delayShow], () => `egg_tip${show.value ? (delayShow.value ? ' active delay' : ' active') : ''}`), |
| 4541 | }, [ |
| 4542 | createElementNode('span', undefined, { |
| 4543 | class: 'egg_text', |
| 4544 | }, createTextNode(text)), |
| 4545 | watchEffectRef(() => countShow.value |
| 4546 | ? createElementNode('span', undefined, { |
| 4547 | class: 'egg_countdown', |
| 4548 | }, createTextNode(watchEffectRef(() => `${count.value}s`))) |
| 4549 | : undefined), |
| 4550 | ], { |
| 4551 | onMounted() { |
| 4552 | // 倒计时 |
| 4553 | const countDown = async () => { |
| 4554 | // 倒计时回调 |
| 4555 | await callback(count.value); |
| 4556 | // 倒计时结束 |
| 4557 | if (!count.value) { |
| 4558 | show.value = false; |
| 4559 | return; |
| 4560 | } |
| 4561 | count.value--; |
| 4562 | setTimeout(countDown, 1000); |
| 4563 | }; |
| 4564 | countDown(); |
| 4565 | }, |
| 4566 | }); |
| 4567 | } |
| 4568 | /** |
| 4569 | * @description 分隔符 |
| 4570 | * @returns |
no test coverage detected