Last active
November 15, 2019 02:24
-
-
Save branflake2267/38097b0fb4e6a1c5a773edf2cf532843 to your computer and use it in GitHub Desktop.
Simple ExtWebComponents View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- usage --> | |
<my-sandbox-view></my-sandbox-view> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>Sandbox View</div> | |
<ext-button | |
text="Normal3" | |
shadow="true" | |
arrowAlign="bottom" | |
></ext-button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import template from './SandboxViewComponent.html'; | |
class SandboxViewComponent extends HTMLElement { | |
constructor() { | |
super() | |
this.innerHTML = template; | |
} | |
connectedCallback() { | |
this._addListeners(); | |
} | |
disconnectedCallback() { | |
} | |
attributeChangedCallback(attrName, oldVal, newVal) { | |
} | |
_addListeners() { | |
var buttonEl = this.querySelector("ext-button"); | |
// works | |
buttonEl.ext.el.on('click', () => { | |
alert('ext on click works'); | |
}); | |
} | |
} | |
window.customElements.define('my-sandbox-view', SandboxViewComponent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment