neuon
v1.0.9
Published
Wrapper web-component for polymer/lit-element
Downloads
3
Readme
Neuon
Wrapper web-component for polymer/lit-element
Visit https://lit-element.polymer-project.org/
Usage
import Neuon from 'neuon'
@Neuon.define('my-element')
class MyElement extends Neuon.Element{
@Neuon.prop title = 'this is a title'
static get styles(){
return Neuon.css`
:host:{
display: block;
}
div {
color: red;
}
`
}
constructor(){
super()
}
template(){
return Neuon.html`
<div>${this.title}</div>
`
}
}
Neuon.Element
- addCustomEvent(name, detail)
document.querySelector('my-element').addCustomEvent('offseting', { x: 10, y: 10})
- on(name, callback)
document.querySelector('my-element').on('offseting', (e) => console.log(e.detail))
// {x:10 y:10}
- dispatch(name, detail)
document.querySelector('my-element').dispatch('offseting', {x: 10, y: 20})