9.0.1 • Published 8 months ago
@riotjs/custom-elements v9.0.1
@riotjs/custom-elements
Simple API to create vanilla custom elements with riot
Demos
Usage
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>
API
This module exports only a single factory function that is a wrapper around the native customElements.define
. The define
function accepts only 3 parameters:
- tag name
- tag api normally generated via riot compiler
- custom options to pass to
customElements.define
like{extends: 'button'}
for example
9.0.1
8 months ago
9.0.0
2 years ago
6.0.1
3 years ago
6.0.0
4 years ago
5.0.0
5 years ago
4.1.1
5 years ago
4.1.0
6 years ago
4.0.0
6 years ago
4.0.0-beta.1
6 years ago
4.0.0-alpha.3
6 years ago
4.0.0-alpha.2
6 years ago
4.0.0-alpha.1
6 years ago
0.1.0
7 years ago
0.0.1
7 years ago
0.0.0
7 years ago