Skip to main content

Delay Attribute

The $delay directive is used to introduce a delay before executing an action, typically on click events.

Usage

~index.html
<button $delay="1000" @click="someAction">Delayed Action</button>

How it Works

  • The framework reads the $delay value (in milliseconds).
  • When the element is clicked, it waits for the specified delay.
  • After the delay, it executes the associated action.

Error Handling

If an invalid delay value is provided, the framework might default to no delay or log an error to the console.

Note

note

This directive is useful for creating deliberately delayed actions, such as preventing accidental double-clicks or creating staggered effects.