x-show with settimeout #1185
rickavmaniac
started this conversation in
3. Feature Ideas
Replies: 3 comments 8 replies
-
@rickavmaniac Interesting idea! For now, you could achieve this using $watch('nameOfProp', function (value) {
if (value) {
setTimeout(() => show = false, 3000)
}
}) |
Beta Was this translation helpful? Give feedback.
5 replies
-
Generally, in the part that creates the message, it's easy enough to just set a timeout right there. or if the element is in a template x-if or x-for, you can just do |
Beta Was this translation helpful? Give feedback.
3 replies
-
{{ session("timelinesuccess") }}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
A common pattern we face everyday is showing a message and hide it after 3 sec.
It would be could if Alpine could have a shortcut for that like
x-show.timeout.3000ms(show)
That would be equivalent to setTimeout(() => show = false, 3000)
Beta Was this translation helpful? Give feedback.
All reactions