A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/riot/custom-elements/ below:

riot/custom-elements: Simple API to create vanilla custom elements with riot

Simple API to create vanilla custom elements with riot

import MyComponent from './my-component.riot'
import define from '@riotjs/custom-elements'

define('x-tag', MyComponent)

Notice that in order to update the component properties via attribute you will need to rely on the observedAttributes array

<my-component>
  <p>{props.message}</p>
  <script>
    export default {
      // the message property will be automatically updated anytime the DOM `message` attribute will change
      observedAttributes: ['message'],
    }
  </script>
</my-component>

This module exports only a single factory function that is a wrapper around the native customElements.define. The define function accepts only 3 parameters:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4