SHARE
TWEET

Untitled

a guest Dec 9th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {
  2.   customElements,
  3.   HTMLElement,
  4.   html
  5. } = require('web-components-node');
  6.  
  7. const page = customElements.export('hello-world', class extends HTMLElement {
  8.   onclick() {
  9.     alert('clicked');
  10.   }
  11.  
  12.   template() {
  13.     return html`
  14.       <h2>Hello World</h2>
  15.       <button onclick="$helloWorld.onclick()">click me</button>
  16.     `;
  17.   }
  18. });
  19.  
  20. module.exports = async () => ({
  21.   title: 'Hello World',
  22.   body: page.build()
  23. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top