1.0.45 • Published 8 years ago

jt-app v1.0.45

Weekly downloads
1
License
ISC
Repository
-
Last release
8 years ago

jt-app

jetone react mobile component kao

目录

0.目录

toc

布局说明(参数可不填,不填都为默认值)

1.Cells

参数说明

回到目录

2. Cell

参数说明
layoutType布局默认inline(横布局),block(垂直布局)
clickFunc点击事件(默认无点击事件)
switch开关模式,只需在标签switch(默认无)
fontSize默认字体为14字号,fontSize:big为16字号,small为14字号

用法 :

回到目录

3.Hd

参数说明
layoutType布局默认inline(横布局),block(垂直布局)

用法:

<Hd layoutType="block"></Hd>

回到目录

4.Bd

参数说明
big直接在Bd标签写big,表示所用字号为16px,默认14px
colorType默认颜色为#333333,当colorType为text时,颜色为#666666,否则为#333333

回到目录

5.Ft

参数说明
layoutType布局默认inline(横布局),block(垂直布局)
link默认为false,true表示有">"的跳转符(link跟changeDirect不能同时为true或是同时为false,如同时为true,link的优先级较高)
changeDirect默认为false,true表示有“∨”的下拉符(link跟changeDirect不能同时为true或是同时为false,如同时为true,link的优先级较高)

用法:

回到目录

6.Icon

参数说明

回到目录

7.Label(默认无参数)

参数说明
checkBox需用到checkbox就填写checkbox
radio需用到radio就填写radio

用法:

<Label checkBox></Label>
<Label radio></Label>
<Label></Label>

回到目录

8.SelectContainer

参数说明
before需将select容器反正最左变就在容器加before(仅需写before)
after默认值

用法:

<SelectContainer before></SelectContainer>
<SelectContainer></SelectContainer>(默认after)

回到目录

各个控件的参数说明(modelType都有默认值)

1.InputCell(默认为:标题+input)

modelType包括iconInput和默认的标题+input(titleInput)

参数说明
data数据源(object)
dataModel参数(object)
typingChangeinput的change事件
clear清除input的内容事件

dataModel的属性表:

modelTypeinput的组合类别
layoutType布局类型,默认水平布局(垂直block/水平)
modelKey对应data(数据源)的属性名
modelName需要显示给别人看的说明文字,如:姓名
inputTypeinput的type类型
icon图片url
disabled默认可读可写(参数值为false或是“rw”),只读:true或是“r”

使用例子

<InputCell 
data={data} 
dataModel={{ modelType:"iconInput", modelName: "姓名", inputType: "text", modelKey: "name",icon:closeIcon,disabled: "r"}} 
typingChange = {typingChange } 
clear={clear}/>

回到目录

2.TextAreaCell(默认布局为横布局,形式都为:标题+textArea)

参数列说明
data数据源(object)
dataModel(object)参数object
typingChangetextarea的change事件

dataModel的属性表:

layoutType布局类型,默认水平布局(垂直block/水平)
modelName需要显示给别人看的说明文字,如:姓名
modelKey对应data(数据源)的属性名

使用例子

<TextAreaCell
data={data} 
dataModel={{ layoutType:"block", modelName: "姓名",modelKey: "name"}} 
typingChange = {typingChange } 
/>

回到目录

3.textCell(默认为:标题+值)

modelType包括text、preTextIcon、textAfterIcon、preTitleTextIcon、titleTextAfterIcon、textLink、preTextIconLink、titleTextLink、 textCollapse、iconTextCollapse、titleTextCollapse、mergeText、mapText、list和默认值(textTitle)

参数列参数属性名
data数据源(object)
dataModel参数object

dataModel的属性表:

modelTypetextCell的组合类型
modelName显示的自定义的名字,如姓名
modelKey对应data(数据源)的属性名
icon图标(图片的链接)
link默认为false,true表示有">",false为没有
clickFunc列表的点击事件
collapseFunc点击列表下拉的事件
isOpenedtrue为点击列表下拉内容,false为收起下拉内容
collapseList点击列表下拉的显示的内容
modelKeyOne左边对应的data值得属性名
modelKeyTwo右边对应的data的属性名
modelLoopKey循环获取字段的的data的属性名
modelKeyArray子数据(数组)
listLayoutType子数据(数组)的布局类型
listModelName子数据(数组)的自定义名称
listModelKey对应子数据(数据源)的属性名
listLayoutType子数据(数组)的布局类型
listInputType子数据(数组)的input的type
listInputDisabled子数据的input是否可读可写,默认可读可写(true或是rw”),只读为false或是“r”

使用例子

A:{ modelType: "preTextIconLink",
 modelName: "姓名",
 modelKey: "name", 
icon: closeIcon, 
clickFunc: (e, data) => myFunction(e, data), link: true },
B: { modelType: "titleTextCollapse", 
modelKeyOne: "name",
 modelKeyTwo: "age", 
collapseFunc: collapseFunc,
 link: true, isOpened: true,
 collapseList: collapseList,
 icon: closeIcon }

4.switchCell(默认为单个的switch(值+switch))

参数说明
data数据源(object)
dataModel参数object

dataModel的属性表:

modelTypeswitchCell的组合类型
switchData需循环switch列表的数据
modelSwitchListKey需循环switch列表的数据的属性名
switchListCheck需循环switch列表开关(true为开,false为关)
switchListChange需循环switch列表的switch的事件
switchListParamOne需循环switch列表的switch的事件的参数1
switchListParamTwo需循环switch列表的switch的事件的参数2
mainSwitchCheck需循环switch列表的总开关(true,false)
mainSwitchChange需循环switch列表的总开关的事件
switch只填switch
switchCheck单个switch的开关(true,false)
typingChange单个switch的事件
paramOne单个switch的事件的参数1
paramTwo单个switch的事件的参数2

使用例子

单个switch
{ componentType: "switchGroup",
 modelKey: "name", 
switchCheck: true,
 paramOne: "name",
 paramTwo: "age", 
typingChange: (name, age) => switchChange(name, age) 
},
     多个switch          
 {
    componentType: "switchGroup",
    modelType: "switchList",
    modelSwitchListKey: "name",
    switchListCheck: "checked",
    switchListChange: (name, age) => switchListChange(name, age),
    switchListParamOne: "id", switchListParamTwo: "age",
    mainSwitchCheck: true,
    mainSwitchChange: mainSwitchChange
 },

回到目录

5.selectCell 默认为:标题+select

modelType包括select、selectText、iconTitleText、titleSelectText和默认值(标题+select(textSelect))

参数说明
datadata数据源(object)
dataModel参数object
typingChangeselect的onchange事件

dataModel的属性表:

layoutType布局类型,默认水平布局(垂直block/水平)
modelTypeselectCell 的组合类型
modelKeyselect所需的data属性名
modelName自定的名字
disabledselect是否可选,默认可选(参数值为false或是“rw”),不可选的参数值为:true或是“r”
selectInputDisabledselect后面的input是否可以读写,默认是可读可写,默认可选(参数值为false或是“rw”),不可选的参数值为:true或是“r”
inputTypeinput的类型(如type=text,只填天text)
modelInputKeyinput所需data的字段名(或是自定的字段名)
modelInputName自定input的名称
iconicon链接
dataSourceselect的数据源

回到目录

6.imageCell 无默认值

modelType包括image和uploadImg

参数列参数属性名
datadata数据源(object)
dataModel参数object

dataModel的属性表:

layoutType布局类型,默认水平布局(垂直block/水平)
modelTypeimageCell的组合类型
modelKey所需data的属性值
modelName自定义名字
baseUrlimg的外网地址
uploadImgFunc打开拍照功能的点击事件
viewImg拍照时查看图片
reviewImg查看图片
delImg删除图片

回到目录

7.checkBoxCell 默认为(checkboxText)

参数列参数属性名
datadata数据源(object)
dataModel参数object

dataModel的属性表:

modelTypecheckBoxCell的类型
modelName自定义名字
modelKey所需data的属性名
checked是否选中(true、false)
checkFunc选中的点击事件

回到目录

8.cardList

modelType暂时只有默认值

参数列参数属性名
datadata数据源(object)
dataModel参数object

dataModel属性表:

modelTypecardList的组合类型
cardData卡片的数据源(Array数组)
modelCardName卡片自定名字
modelCardKey卡片数据的属性
modelCardStatus卡片数据的属性(变成一个圆形显示)
modelCardId传入卡片操作事件的卡片数据id
firstBtnName卡片按钮的名字1
secondBtnName卡片按钮的名字2
firstClickFunc卡片按钮1的点击事件
secondClickFunc卡片按钮1的点击事件

回到目录

9.formView 默认为input的组合

componentType包括inputGroup(InputCell)、textAreaGroup(TextareaCell)、imageGroup(ImageCell)、selectGroup(SelectCell)、 checkBoxGroup(CheckBoxCell)、switchGroup(SwitchCell)、cardGroup(CardList)和默认组合(textCell)

参数参数属性名
datadata数据源(object)
dataModel参数Array
typingChangeInputCell、TextareaCell的触发事件
clearInputCell的清除输入的的触发事件
buttons传入btn的数组
btnPositionbtn的放的位置,默认在放在内容结束后,如要固定在屏幕最底部,需设置btnPosition=’bottom‘

dataModel的参数表 componentType | formView 使用的cell类型 --------------|------------------- 其余参数 | 其余参数根据componentType的类型找到对应的Cell填写对应的参数值

buttons的参数表 btnText | 自定义按钮名称 --------------|------------------- disabled | 按钮是否可点击 btnFunc | 点击按钮触发的事件

 buttons={
     [
        {
            btnText: "登录", disabled: true, btnFunc: login
        }
    ]
}

回到目录

10.toast

方法keytypeduration文本
showToast自定义key名称(必填)fail、success两种type(必填)设置多少秒后消失弹框(1代表1秒),null为弹框不自动消失(必填)设置文本内容,如:操作成功(文字数量不限)
showLoading自定义key名称(必填)无此参数无此参数设置文本内容,如:正在加载(文字4个+’···‘)
hideToast传入以上自定义的key名称(必填)无此参数无此参数无此参数

回到目录

1.0.45

8 years ago

1.0.44

8 years ago

1.0.43

8 years ago

1.0.42

8 years ago

1.0.41

8 years ago

1.0.40

8 years ago

1.0.39

8 years ago

1.0.38

8 years ago

1.0.37

8 years ago

1.0.36

8 years ago

1.0.35

8 years ago

1.0.34

8 years ago

1.0.33

8 years ago

1.0.32

8 years ago

1.0.31

8 years ago

1.0.30

8 years ago

1.0.29

8 years ago

1.0.28

8 years ago

1.0.27

8 years ago

1.0.26

8 years ago

1.0.25

8 years ago

1.0.24

8 years ago

1.0.23

8 years ago

1.0.22

8 years ago

1.0.21

8 years ago

1.0.20

8 years ago

1.0.19

8 years ago

1.0.18

8 years ago

1.0.17

8 years ago

1.0.16

8 years ago

1.0.15

8 years ago

1.0.14

8 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago