1.0.1 • Published 7 years ago

gts-weex-components v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

@ali/weex-ui-components

A ui-components webpack for weex.

Install

npm install gts-weex-components --save

Usage

已有组件:

button/button-group/button-icon/button-plain/cell-item/cells-item/col/form-item/icon/input/line/list/menu/picker/row/search/select/slider/switch/tab/tabbar/textarea/textarea-withcount/upload

使用方法:按需引入 require('weex-ui-components/组件名称')

Each component attributes as follows:

1.Button 组件

按钮组件,以下分别是基本按钮、朴素按钮、图标按钮的属性说明:

Button Attributes

参数说明类型可选值默认值
size尺寸stringlarge,small
type类型stringprimary,secondary,warning,text
disabled是否禁用状态booleanfalse

Plain Button Attributes

参数说明类型可选值默认值
size尺寸stringlarge,small
type类型stringprimary,secondary,warning
disabled是否禁用状态booleanfalse

Icon Button Attributes

参数说明类型可选值默认值
size尺寸stringlarge,small
type类型stringprimary,secondary,warning,text
disabled是否禁用状态booleanfalse
icon图标,已有的图标库中的图标名stringIcon List

2.Cell-item 组件

类似于form的列表视图,用于将信息以列表的结构显示在页面上,属性说明如下:

Cell-item Attributes

参数说明类型可选值默认值
access是否有图标booleanfalse
last是否为最后一列booleanfalse
cellIcon图标string
title标题文字string
desc说明文字string

3.Cells-item组件

列表视图集合,属性说明如下:

Cell-item Attributes

参数说明类型可选值默认值
title列表标题string

4.Col组件

栅格布局组件,属性说明如下:

Col Attributes

参数说明类型可选值默认值
span栅格占据的列数number-

5.Form-cell组件

由输入框、选择器、单选框、多选框等控件组成,用以收集、校验和提交数据。属性说明如下:

Form Attributes

参数说明类型可选值默认值
inline是否在同一行booleantrue
align排列方式stringleft
label标签string
width用于计算标签宽度number
last是否为最后一列booleanfalse

6.Gallery组件

Gallery Attributes

参数说明类型可选值默认值
index图片标志string
galleryImgSrc图片路径string

7.Icon组件

图标更新步骤: 1.登录http://www.iconfont.cn/plus 2.找到想添加的图标添加至项目vue-com 3.更新Unicode的在线链接 4.将icon.vue文件中的url('//at.alicdn.com/t/***.ttf')替换掉 5.在icon.data.js中添加图标的名称和对应的code,搞定!

Icon Attributes

参数说明类型可选值默认值
name图标名称string

8.input组件

Input Attributes

参数说明类型可选值默认值
type类型stringtext/password/url/email/teltext
value绑定值string, number
maxlength最大输入长度number
placeholder输入框占位文本string
disabled禁用booleanfalse
autofocus原生属性,自动获取焦点booleantrue, falsefalse

Input Events

事件名称说明回调参数
blur在 Input 失去焦点时触发(event: Event)
focus在 Input 获得焦点时触发(event: Event)
change在 Input 值改变时触发(value: string | number)

9.Line组件

宽度为1的白色分隔线

10.List组件

分为纯文字无序列列表、图文混排列表、有序列表、节点列表。属性说明如下:

List Attributes

参数说明类型可选值默认值
hasseq是否有序列booleanfalse
hasnode是否有节点booleanfalse
imgSrc图片路径string
itemTitle列表名称string--
itemContent列表内容string--
inline名称时间状态是否在一行上boolean--
itemName名字string--
nameColor名字颜色string--
itemSize名字字体大小number--
itemTime时间string--
timeColor时间颜色string--
timeSize时间字体大小number--
itemStatus状态string--
starusColor状态颜色string--
starusSize状态字体大小number--

11.Picker 组件

Picker Attributes

参数说明类型可选值默认值
typepicker 的类型stringdate,timedate
placeholder占位文本string请选择
value绑定值stringdate 类型时格式为 yyyy-mm-dd; time 类型时格式为 hh:mm

Picker Events

事件名称说明回调参数
select点击data选择器触发的事件选中的data值

12.Row 组件

Row Attributes

参数说明类型可选值默认值
gutter栅格间隔number0
justifyflex 布局下的水平排列方式stringstart/end/center/space-around/space-betweenstart
alignflex 布局下的垂直排列方式stringtop/middle/bottomtop

13.Search组件

搜索框组件

Search Attributes

参数说明类型可选值默认值

14.Select 组件

Select Attributes

参数说明类型可选值默认值
selectStyle选中样式stringborderStyle/iconStyle-
selectOne是否为单选booleantrue
radioList选项数组array
isRow选项是否排列在一行booleantrue
isRadio选项是否为圆形booleantrue
maxLimit最多选中个数number--
radioList.index选项标志string
radioList.checked是否选中booleanfalse
radioList.value选项对应的值string
radioList.label选项标签string

Select Events

事件名称说明回调参数
select点击select触发的事件index,value

15.Slider 轮播组件

Select Attributes

参数说明类型可选值默认值
interval切换时间(ms)number--
autoPlay是否自动播放booleantrue
imageList图片列表array
indicatorColor导航颜色string-
indicatorLeft导航距左侧距离number-

16.Switch 组件

Switch Attributes

参数说明类型可选值默认值
checked是否选中booleanfalse
disabled是否禁用booleanfalse

Events

事件名称说明回调参数
changeswitch 状态发生变化时的回调函数新状态的值

17.Tab组件

由横向和垂直tab组成, 属性说明如下:

Tab Attributes

参数说明类型可选值默认值
inline是否在同一行booleantrue
tabWidth纵向tab的宽度设置number-
selectedColor选中颜色string--
tabList标签内容array-

18.Tabbar组件

底部导航栏, 属性说明如下:

Tab Attributes

参数说明类型可选值默认值
tabitemtab参数array
tabitem[].titletab名称string
tabitem[].iconicon名称string
tabitem[].visibilitytab是否被选择boolean
itemstyle样式参数object
itemstyle.titleColor名称颜色string
itemstyle.selectedTitleColor被选中后名称颜色string
itemstyle.iconColor图标颜色string
itemstyle.selectedIconColor被选中后图标颜色string

19.Textarea

Textarea Attributes

参数说明类型可选值默认值
value绑定值string, number
maxlength最大输入长度number
placeholder输入框占位文本string
disabled禁用booleanfalse
rows输入框行数number2
autofocus原生属性,自动获取焦点booleantrue, falsefalse

Textarea Events

事件名称说明回调参数
blur在 Textarea 失去焦点时触发(event: Event)
focus在 Textarea 获得焦点时触发(event: Event)
change在 Textarea 值改变时触发(value: string | number)

20.Upload组件

通过点击上传图片,属性说明如下:

Upload Attributes

参数说明类型可选值默认值
index图片标志string
title上传标题string
limit是否有数量上限booleanfalse
uploadLimit上传数量上限number9
desc上传解释详情string9
uploadList照片路径列表array-
enabled是否还能再上传booleantrue