2.1.0-beta.1 • Published 28 days ago

@wu-component/web-core-plus v2.1.0-beta.1

Weekly downloads
-
License
ISC
Repository
github
Last release
28 days ago

Install 安装

快速创建

需要提前全局安装 t-cli 脚手架,关于 wu-cli 详见 使用指南

wu init-web-component test-web-core-component

开发构建

开发

该命令用于本地启动一个热更新的服务,用于本地开发。

npm run dev:package

构建

该命令用于打包 webComponent, 该命令会构建出 umd、es、cjs 三种格式的产物,umd 格式可以直接在浏览器中预览效果。

npm run build:package

预览

该命令用于预览效果,浏览器默认打开根目录 index.html 文件, index.html 按需要修改,

npm run example:package

手动依赖

开发者可以根据需要手动安装依赖,相关 Api

npm install @wu-component/web-core-plus --save

示例如下:

import { h, Component, Prop, WuComponent } from '@wu-component/web-core-plus';
import css from './index.scss';
import { extractClass } from '@wu-component/common';
type WuButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info';
type NativeType = 'button' | 'submit' | 'reset';
type UISize = 'medium' | 'small' | 'mini';

@Component({
    name: 'wu-plus-button',
    css: css,
})
export class WuButton extends WuComponent {
    constructor() {
        super();
    }

    @Prop({ default: 'primary', type: String })
    public type: WuButtonType;

    @Prop({ default: 'mini', type: String })
    public size: UISize;

    @Prop({ default: false, type: Boolean })
    public plain: boolean;

    @Prop({ default: false, type: Boolean })
    public round: boolean;

    @Prop({ default: false, type: Boolean })
    public circle: boolean;

    @Prop({ default: false, type: Boolean })
    public loading: boolean;

    @Prop({ default: false, type: Boolean })
    public disabled: boolean;

    @Prop({ default: '', type: String })
    public icon: string;

    @Prop({ default: 'button', type: String })
    public nativeType: NativeType;

    @Prop({ default: '', type: String })
    public text: string;

    public override render(_renderProps = {}, _store = {}) {
        return (
            <button
                disabled={this.disabled}
                {...extractClass({}, 'wu-button', {
                    ['wu-button-' + this.type]: this.type,
                    ['wu-button-' + this.size]: this.size,
                    'is-plain': this.plain,
                    'is-round': this.round,
                    'is-circle': this.circle,
                    'is-disabled': this.disabled,
                })}
                type={this.nativeType}
            >
                {this.loading && [
                    <svg class="loading" viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true">
                        <path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" />
                    </svg>,
                    ' ',
                ]}
                {this.text}
                <slot />
            </button>
        );
    }
}
@infinitebrahmanuniverse/nolb-_wu@everything-registry/sub-chunk-1024@wu-component/wu-radio@wu-component/wu-rate@wu-component/wu-right-menu@wu-component/wu-row@wu-component/wu-select@wu-component/wu-select-option@wu-component/wu-steps@wu-component/wu-switch@wu-component/wu-table@wu-component/wu-tag@wu-component/wu-terminal@wu-component/wu-time-line@wu-component/wu-time-line-item@wu-component/wu-tooltip@wu-component/wu-transition@wu-component/wu-tree@wu-component/wu-tree-v2@wu-component/wu-upload@wu-component/wu-waline-comment@wu-component/wu-waline-comment-sandbox@wu-component/wu-popover@wu-component/wu-progress@wu-component/wu-provide@wu-component/ui-plus@wu-component/wu-alert@wu-component/wu-aside@wu-component/wu-badge@wu-component/wu-breadcrumb@wu-component/wu-cesium-map@wu-component/wu-checkbox@wu-component/wu-checkbox-button@wu-component/wu-checkbox-group@wu-component/wu-code-monaco-editor@wu-component/wu-code-playground@wu-component/wu-code-sandbox@wu-component/wu-col@wu-component/wu-date-picker@wu-component/wu-dialog@wu-component/wu-empty@wu-component/wu-footer@wu-component/wu-form@wu-component/wu-form-item@wu-component/wu-form-label-wrap@wu-component/wu-form1@wu-component/wu-header@wu-component/wu-icon@wu-component/wu-inject@wu-component/wu-main@wu-component/wu-mapbox-map@wu-component/wu-menu@wu-component/wu-avatar@wu-component/wu-breadcrumb-item@wu-component/wu-button@wu-component/wu-card@wu-component/wu-cascader@wu-component/wu-collapse@wu-component/wu-collapse-item@wu-component/wu-color-picker@wu-component/wu-container@wu-component/wu-core-router@wu-component/wu-image@wu-component/wu-input@wu-component/wu-input-number@wu-component/wu-leaflet-map@wu-component/wu-link@wu-component/wu-lottie@wu-component/wu-menu-item@wu-component/wu-menu-item-group@wu-component/wu-menu-sub@wu-component/wu-message@wu-component/wu-page-header@wu-component/wu-pagination@wu-component/wu-popconfirm
2.1.0-beta.1

28 days ago

2.0.4

5 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

0.3.42

1 year ago

0.3.41

1 year ago

0.3.40

1 year ago

0.3.31

1 year ago

0.3.30

1 year ago

0.3.39

1 year ago

0.3.38

1 year ago

0.3.37

1 year ago

0.3.36

1 year ago

0.3.35

1 year ago

0.3.34

1 year ago

0.3.33

1 year ago

0.3.32

1 year ago

0.3.29

1 year ago

0.3.28

1 year ago

0.3.27

1 year ago

0.3.26

1 year ago

0.3.25

1 year ago

0.3.24

1 year ago

0.3.23

1 year ago

0.3.22

1 year ago

0.3.21

1 year ago

0.3.20

1 year ago

0.3.19

1 year ago

0.3.18

1 year ago

0.3.17

1 year ago

0.3.16

1 year ago

0.3.15

1 year ago

0.3.14

1 year ago

0.3.13

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.3.9

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.46

2 years ago

0.1.46

2 years ago

0.0.46

2 years ago

0.0.44

2 years ago

0.0.43

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago