How to use the domponent/dist/domponent.development.js.Init function in domponent

To help you get started, we’ve selected a few domponent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tamb / domponent / examples / site / src / index.js View on Github external
document.addEventListener("DOMContentLoaded", function() {
  document.querySelectorAll(`[data-action="click.jump"]`).forEach(el => {
    el.addEventListener("click", e => {
      e.preventDefault;
      const anchor = e.target;
      console.log(anchor);
      jump(anchor.getAttribute("href"));
    });
  });

  const app = new Init({
    selector: document.body,
    components: {
      Counter,
      HoverBuddy
    }
  });

  console.log(app);
});

domponent

Build components with the HTML you already have.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis