Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wibus-wee-ac/wc-lantern

Lantern for Web Components
https://github.com/wibus-wee-ac/wc-lantern

Last synced: about 1 month ago
JSON representation

Lantern for Web Components

Awesome Lists containing this project

README

        

# Lantern for Web Components

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/wibus-wee/lantern-element) [![npm](https://img.shields.io/npm/v/wc-lantern)](https://www.npmjs.com/package/wc-lantern)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/wc-lantern)
![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hy/wc-lantern)

> ~~Learn from [从零开始写一个 Web Component - GitHub Corners | 云游君的小站](https://www.yunyoujun.cn/posts/how-to-write-a-web-component/)~~

A web component by ~~[lit](https://github.com/lit/lit)~~ [jwc.js](https://jwc.js.org/)

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

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

## Usage

```bash
npm i wc-lantern
```

### By CDN

See [demo/index.html](https://github.com/wibus-wee/wc-lantern/blob/main/demo/index.html)

```html

```

### By NPM

```ts
// main.ts
import "wc-lantern"
```

```html

```

## API

### Example

```html

```

### `src/index.ts`:

#### class: `LanternElement`

##### Superclass

| Name | Module | Package |
| ------------ | ------ | ------- |
| `JwcComponent` | | jwcjs |

##### Fields

| Name | Privacy | Type | Default | Description | Inherited From |
| --------------- | ------- | --------- | --------- | --------------------------------------------------------------------------------------------- | -------------- |
| `text` | | `string` | `'春,节'` | The text on lantern,use \`,\` to divide the text | |
| `number` | | `number` | `2` | The number of lanterns returned, up to 2 | |
| `displayMobile` | | `boolean` | `false` | display on moblie (very not recommended) | |
| `disPlayBoth` | | `boolean` | `false` | Whether to display left or right; otherwise, the output will be based on the 'position' field | |
| `position` | | `string` | `'right'` | The position of the lantern, left or right | |


## Author

wc-lantern © Wibus, Released under the MIT License.

> [Personal Website](http://iucky.cn/) · [Blog](https://blog.iucky.cn/) · GitHub [@wibus-wee](https://github.com/wibus-wee/) · Telegram [@wibus✪](https://t.me/wibus_wee)