项目作者: author-elements

项目描述 :
Base class for all custom elements (web components)
高级语言: JavaScript
项目地址: git://github.com/author-elements/base.git
创建时间: 2019-01-18T22:23:38Z
项目社区:https://github.com/author-elements/base

开源协议:MIT License

下载


AuthorBaseElement @author.io/element-base?path=dist""> Build Status

This is the base class used to build Author.io custom HTML elements (web components). It provides incredibly lightweight utilities and was designed for optimizing all <author-*> custom tags.

Source Size @author.io/element-base.svg?colorB=%23333333&label=Minified-Gzipped&logo=JavaScript&style=for-the-badge" alt="Deliverable Size"> @author.io/element-base.svg?colorB=%23333&label=%40author.io%2Felement-base&logo=npm&style=for-the-badge" alt="npm">

We’re using BrowserStack to make sure these components work on the browsers developers care about.

Usage

This library must be included once in HTML pages before any author-* tags.

There are 4 versions of the base class available:

  1. author-base.min.js (ES6 Minified for Production)
  2. author-base.js (ES6 Unminified for Debugging)
  3. author-base.es5.min.js (ES5 Minified for Production)
  4. author-base.es5.js (ES5 Unminified for Debugging)

Each version has it’s own source map, so it’s always possible to trace activity back to a specific code block in the source.

You only need to choose one of these files. If you need to support Internet Explorer, older versions of Chrome/Firefox/Safari, then you likely need the ES5 version.

Via Global CDN

  1. <html>
  2. <head>
  3. <script src="https://cdn.author.io/author-elements/base/1.0.0/author-base.min.js"></script>
  4. <script src="https://cdn.author.io/author-elements/whatever/x.x.x/author-whatever.min.js"></script>
  5. </head>
  6. </html>

Via npm

First install the module locally:

npm install @author.io/element-base -S

Then include it in your HTML:

  1. <html>
  2. <head>
  3. <script src="./node_modules/@author.io/element-base/dist/author-base.min.js"></script>
  4. <script src="https://domain.com/path/to/custom/element.js"></script>
  5. </head>
  6. </html>