wm-tabs
v1.0.7
Published
小程序自定义组件 > 使用此组件需要依赖小程序基础库 2.2.1 以上版本,同时依赖开发者工具的 npm 构建。具体详情可查阅官方 npm 文档。
Downloads
12
Readme
wm-tabs
小程序自定义组件
使用此组件需要依赖小程序基础库 2.2.1 以上版本,同时依赖开发者工具的 npm 构建。具体详情可查阅官方 npm 文档。
使用方法
- 安装 wm-tabs:
npm install --save wm-tabs
- 在需要使用 wm-tabs 的页面page.json 中添加 wm-tabs自定义组件配置:
{
"usingComponents": {
"tabs": "wm-tabs"
}
}
- wxml文件中引用wm-tabs:
<tabs tabs-arr = '{{tabArr}}'
bind:selectTab = '_selectTabFunc'
type = '1'>
</tabs>
- wm-tabs的属性介绍如下:
| 属性名| 类型 | 是否必须 | 内容 | | --- | --- | ---| --- | tabs-arr| Array | 是 | [{text: '标签名', selected: true(选中,false:不选中)}] type | Number | 是 | 1: 选中字体变大 2: 带下划线 selectTab | function | 否 | 选择事件,返回参数e: 选中标签的内容