1.0.1 • Published 7 months ago

@ls-design/core v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

基于 quarkccore

提供了对 @ls-design/ui的底层支持, 以更友好的姿态实现了Web Components

⚙️ 安装

npm install @ls-design/core --save

🚀 使用示例

import { Property, CustomElement, createRef, LSElement } from '@ls-design/core';
import style from './style.css';

@CustomElement({
  tag: "ls-button",
  style,
})
class Button extends LSElement {
  @Property() // @Property提供响应式外部属性
  type = '';

  @Property({
    type: Boolean,
  })
  disabled = false;

  @State // 组件内部响应式元素
  isShow = false,

  slotRef: any = createRef(); // 创建ref

  render() {
    ...
  }
}

除了上述 使用示例 外的能力基本参考了quarkc,可直接其阅读文档