Skip to content

creco-org/vanilla-component.js

Repository files navigation

vanilla-component.js

vanilla-component.js

overview

It's just template library with vanilla JavaScript.

features

  • fetch template files and rendering to target DOM

Example

image

<div class="greeting">
  <h2>Hello World!!!!!</h2>
</div>

<style>
  .greeting h2 {
    color: skyblue;
    font-weight: bold;
    font-size: 50px;
    text-align: center;
  }
</style>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>demo</title>
    <script src="//cdn.creco.me/packages/vanilla-component.js/0.0.1/vanilla-component.min.js"></script>
  </head>

  <body>
    <VanillaComponent src="components/greeting" />
  </body>
</html>