1.0.3 • Published 2 years ago

niu_xcx_ci v1.0.3

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

牛哥的小程序组件库 v1.0.3

查看代码源:https://gitee.com/HnaQian/niu-xcx-ci

安装

npm install -g niu_xcx_ci@latest

示例

$ niu
Usage: niu [options] [command]

Options:
  -V, --version        output the version number
  -h, --help           display help for command

Commands:
  init <projectName>   项目初始化
  add <componentName>  添加组件
  help [command]       display help for command

更新日志

  • 2022-03-24 v1.0.3

添加使用文档

组件库

1、QActionSheet 弹窗组件

该组件作为底层基础组件,可以直接在页面中使用实现简单的弹窗,也可在此基础之上编写一定业务的自定义组件

属性类型默认值必填说明
isShowBooleanFalse是否展示弹窗
actionTypeBOTTOM/CENTERCENTER展示位置
iscloosebgBooleantrue点击阴影是否关闭弹窗
zIndexNumber998弹窗层级
closeModaleventhandle当关闭弹窗时

actionType=BOTTOM的示例:

{
  "usingComponents": {
    "QActionSheet": "/components/QActionSheet/index"
  }
}
<QActionSheet
  isShow="{{isShowTan}}"
  actionType="BOTTOM"
>
  <view class="test" slot="actionContent">
  </view>
</QActionSheet>

2、QButton 按钮

属性类型默认值必填说明
widthNumber350宽度(rpx)
plainbooleanfalse按钮是否镂空,背景色透明
{
  "usingComponents": {
    "QButton": "/components/QButton/index"
  }
}
<QButton width="{{686}}">确认</QButton>

3、QFormTCI 表单输入组合

包含标题、内容和一个图片/视频

属性类型默认值必填说明
formdataeventhandle当数据发生变化的时候都会被调用
{
  "usingComponents": {
    "QFormTCI": "/components/QFormTCI/index"
  }
}
<QFormTCI catch:formdata="formdata"></QFormTCI>

IMG_2334

4、QKeyValueList 键值展示列表

属性类型默认值必填说明
listArray[]数据

list:

属性类型说明
keystring左边文案
valuestring右边文案
urlstring如果不为空,会出现向右箭头,点击可以跳转
{
  "usingComponents": {
    "QKeyValueList": "/components/QKeyValueList/index"
  }
}
<QKeyValueList list="{{uinfo}}" />

5、QModal modal弹窗(依赖组件QActionSheet)

属性类型默认值必填说明
isShowBooleanFalse是否展示弹窗数据
titlestring标题
iscloosebgBooleantrue点击阴影是否关闭弹窗
leftBtneventhandle确定
rightBtneventhandle取消
{
  "usingComponents": {
    "QModal": "/components/QModal/index"
  }
}
<QModal isShow="{{show}}" title="确定要出去么?" catch:leftBtn="leftBtn" catch:rightBtn="rightBtn" />

6、QNavigationBar 导航栏

属性类型默认值必填说明
homeUrlString/pages/index/index是否展示弹窗数据
modeBLACK、WHITEBLACK文字模式(白色、黑色)
titleString标题
customStyleString自定义背景样式
leftIconTypeBACK、EMPTYBACK左边icon类型(返回,空白)

7、QPage 页面基础组件 (依赖组件QNavigationBar)

属性类型默认值必填说明
navigatorobjectnull导航栏属性见QNavigationBar的属性,如果为null,则不展示导航栏

8、QSwiper 轮播图

属性类型默认值必填说明
dataSourceArray[]数据源
heightnumber300高度(rpx)

datasource:

属性类型说明
imgstring图片链接
urlstring如果为空,点击不可以跳转

9、QTabs

属性类型默认值必填说明
tabListarray\<{text:string}>tab数据
currentNumber0默认第几个高亮
typeCENTER、LEFTCENTER展示类型,居中、居左
changeCurrenteventhandle切换tab的时候

10、QTagChoose 标签选择

属性类型默认值必填说明
titlestring标题标题
tagsarray《string》[]选项
tagChangeeventhandleCENTER点击了选项

11881648109179_.pic