Skip to content

skyyangyun/yi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yi

An easy way to use Web Components.

Installation

Only support ES6 module in browser.

import Yi from "./yi.js"

Usage

  1. write a HelloWorld.html file
<template>
    <div>Hello <slot>world</slot></div>
</template>

the template file name must same with component name in order to load by Yi 2. write a HelloWorld.js file

import Yi from '../src/yi.js'

export default class HelloWorld extends Yi {

}
  1. import and register your component in you ecmascript
<html>
    <head></head>
    <body>
    <hello-world></hello-world>
    <hello-world>Yi</hello-world>
    <script type="module">
        import HelloWorld from "./HelloWorld.js";
        customElements.define('hello-world', HelloWorld)
    </script>
    </body>
</html>

you can see example in example dir

About

A easy way to use Web Components.

Resources

Stars

Watchers

Forks

Packages

No packages published