0.1.3 • Published 2 years ago

wc-lantern v0.1.3

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Lantern for Web Components

Published on webcomponents.org npm npm bundle size jsDelivr hits (npm)

Learn from 从零开始写一个 Web Component - GitHub Corners | 云游君的小站

A web component by lit

The final product is an ES module, and it can be used alone.

Anywhere like Vanilla JS / Vue / React / Angular / Svelte ...

Demo

npm.io

Usage

npm i wc-lantern

By CDN

See demo/index.html

<!-- cdn -->
<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/wc-lantern@latest"
></script>

By NPM

// main.ts
import "wc-lantern"
<!-- index.html -->
<lantern-element></lantern-element>

API

Example

<lantern-element
  number="2"
  text="Good,Great"
  disPlayBoth
></lantern-element>
<lantern-element
  number="2"
  position="right"
  text="Good,Great"
></lantern-element>

src/index.ts:

class: LanternElement

Superclass
NameModulePackage
LitElementlit
Fields
NamePrivacyTypeDefaultDescriptionInherited From
textstring'春,节'The text on lantern,use `,` to divide the text
numbernumber2The number of lanterns returned, up to 2
displayMobilebooleanfalsedisplay on moblie (very not recommended)
disPlayBothbooleanfalseWhether to display left or right; otherwise, the output will be based on the 'position' field
positionstring'right'The position of the lantern, left or right

Author

GS-server © Wibus, Released under the MIT License.

Personal Website · Blog · GitHub @wibus-wee · Telegram @wibus✪

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago