@cldn/components - v4.1.0
    Preparing search index...

    Class DocumentComponent

    A DocumentFragment component

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    This component's node

    Methods

    • Run a function in the context of this component

      Parameters

      • fn: (this: this, component: this) => any

        Provides this component as the first argument and this.

      Returns this

    • Add event listener

      Parameters

      • type: string

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: Event, component: this) => any

        The function that is called when an event of the specified type occurs.

      Returns DocumentComponent

    • Add event listener

      Parameters

      • type: string

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: Event, component: this) => any

        The function that is called when an event of the specified type occurs.

      • options: AddEventListenerOptions

        An object that specifies characteristics about the event listener. See options on MDN

      Returns DocumentComponent

    • Add event listener

      Parameters

      • type: string

        A case-sensitive string representing the event type to listen for.

      • listener: (ev: Event, component: this) => any

        The function that is called when an event of the specified type occurs.

      • useCapture: boolean

      Returns DocumentComponent

    • Template literal tag function that accepts HTML code with components in a string literal

      Parameters

      • strings: TemplateStringsArray
      • ...components: any[]

      Returns DocumentComponent

      This method should only be used with trusted inputs to avoid XSS vulnerabilities.