element-vir - v26.14.0
    Preparing search index...

    Variable onDomCreatedConst

    onDomCreated: (
        ...values: [callback: OnDomCreatedCallback],
    ) => DirectiveResult<typeof __class> = ...

    A directive that fires its listener only once, when the element that it's attached to is constructed. This is particularly useful for getting references to internal elements immediately after they've rendered.

    Type Declaration

    import {html, defineElement, onDomCreated} from 'element-vir';

    const MyElement = defineElement()({
    tagName: 'my-element',
    render() {
    return html`
    <div
    ${onDomCreated((element) => {
    console.log('created!', element);
    })}
    >
    Some div
    </div>
    `;
    },
    });