1.2.1 • Published 5 days ago

@wiajs/ui v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

English | Chinese

Wia UI

UI mponents for wia applications.

See wia components documentation for detailed description.

Some components copy from F7 and removed tight integration with the Wia App, You need to new and manual process code。

install

You will need Node.js installed on your system.

First, install

$ npm i -D @wiajs/ui

To use

Take uploader as an example, to make a register page

in register.js file:

import Uploader from '@wiajs/ui/uploader';

function init(pg)
  _uploader = new Uploader({
    upload: true, // 自动上传
    url: _url, // 上传网址
    dir: 'star/etrip/demo', // 图片存储路径,格式: 所有者/应用名称/分类
    el: pg.clas('uploader'), // 组件容器
    input: pg.name('avatar'), // 上传成功后的url填入输入框,便于提交
    choose: pg.name('choose'), // 点击触发选择文件

    multiple: false, // 可否同时选择多个文件
    limit: 1, // 文件数限制 -1 0 不限,1 则限制单个文件,如 头像
    accept: 'image/jpg,image/jpeg,image/png,image/gif', // 选择文件类型
    compress: true, // 自动压缩
    quality: 0.5, // 压缩比

    // xhr配置
    data: {}, // 添加到请求头的内容
  });

in your register.less file:

@import '@wiajs/ui/dist/uploader/index.less';

in your register.html file:

  <div class="page-content">
    <form name="fmData">
      <div class="list inline-labels">
        <ul>
          <li class="avatar">
            <a href="" class="item-link item-content">
              <div class="item-title item-label">头像<span>*</span></div>
              <div name="choose" class="item-inner">
                <div class="item-after uploader">
                  <input name="avatar" type="hidden" />
                </div>
              </div>
            </a>
          </li>
        </ul>
      <div>
    </form>
  </div>
1.2.0

5 days ago

1.2.1

5 days ago

1.1.9

9 days ago

1.1.8

9 days ago

1.1.7

2 months ago

1.1.6

3 months ago

1.1.5

3 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.1.1

7 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

9 months ago

1.0.6

9 months ago