fn
tryOnBeforeMount
v0.0.1demoCall onBeforeMount if it's inside a component lifecycle hook, otherwise just calls it
Examples
ts
tryOnBeforeMount(() => console.log('Before mount'));ts
tryOnBeforeMount(() => console.log('Before mount async'), { sync: false });Demo
Loading demo…
Signature
ts
export function tryOnBeforeMount(fn: VoidFunction, options: TryOnBeforeMountOptions ={ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
fn | VoidFunction | The function to run on before mount. |
options? | TryOnBeforeMountOptions | The options for the function. |