feat: remove barrel file
This commit is contained in:
parent
9d539f32a3
commit
de673e2f12
5 changed files with 22 additions and 6 deletions
17
demo/Counter.mjs
Normal file
17
demo/Counter.mjs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// @ts-check
|
||||||
|
import WebComponent from "../src/WebComponent.js";
|
||||||
|
|
||||||
|
export class Counter extends WebComponent {
|
||||||
|
static properties = ["count"];
|
||||||
|
|
||||||
|
onInit() {
|
||||||
|
this.props.count = 0;
|
||||||
|
this.onclick = () => ++this.props.count;
|
||||||
|
}
|
||||||
|
|
||||||
|
get template() {
|
||||||
|
return `<button id="btn">${this.props.count}</button>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
customElements.define("my-counter", Counter);
|
|
@ -1,5 +1,5 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
import WebComponent from "../src/index.js";
|
import WebComponent from "../src/WebComponent.js";
|
||||||
|
|
||||||
export class HelloWorld extends WebComponent {
|
export class HelloWorld extends WebComponent {
|
||||||
static properties = ["my-name", "emotion"];
|
static properties = ["my-name", "emotion"];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "web-component-base",
|
"name": "web-component-base",
|
||||||
"version": "1.12.13",
|
"version": "1.12.13",
|
||||||
"description": "A zero-dependency, ~760 Bytes (minified & brotlied), JS base class for creating reactive custom elements easily",
|
"description": "A zero-dependency, ~760 Bytes (minified & brotlied), JS base class for creating reactive custom elements easily",
|
||||||
"main": "index.d.ts",
|
"main": "WebComponent.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npx simple-server .",
|
"start": "npx simple-server .",
|
||||||
|
|
|
@ -43,7 +43,8 @@ export class WebComponent extends HTMLElement {
|
||||||
* A camelCase counterpart using `WebComponent.props` will give read/write access to any attribute, with or without the `data-*` prefix.
|
* A camelCase counterpart using `WebComponent.props` will give read/write access to any attribute, with or without the `data-*` prefix.
|
||||||
* @see https://www.npmjs.com/package/web-component-base#prop-access
|
* @see https://www.npmjs.com/package/web-component-base#prop-access
|
||||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
||||||
* @type {DOMStringMap}
|
* @typedef {{[name: string]: any}} PropStringMap
|
||||||
|
* @type {PropStringMap}
|
||||||
* @example
|
* @example
|
||||||
*
|
*
|
||||||
* class HelloWorld extends WebComponent {
|
* class HelloWorld extends WebComponent {
|
||||||
|
@ -61,7 +62,7 @@ export class WebComponent extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {DOMStringMap}
|
* @type {PropStringMap}
|
||||||
*/
|
*/
|
||||||
#props;
|
#props;
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
import { WebComponent } from "./WebComponent.js";
|
|
||||||
export default WebComponent;
|
|
Loading…
Reference in a new issue