# Sidebar 侧边导航
### 引入
全局引入,在miniprogram根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。
```json
// app.json 或 index.json
"usingComponents": {
"wr-sidebar": "path/to/components/goods-category/wr-sidebar/index",
"wr-sidebar-item": "path/to/component/goods-category/wr-sidebar/wr-sidebar-item/index"
}
```
## 代码演示
### 基础用法
通过在`wr-sidebar`上设置`activeKey`属性来控制选中项
```html
<wr-sidebar active-key="{{ activeKey }}" bind:change="onChange">
<wr-sidebar-item title="标签名称" />
<wr-sidebar-item title="标签名称" />
<wr-sidebar-item title="标签名称" />
</wr-sidebar>
```
``` javascript
Page({
data: {
activeKey: 0
},
onChange(event) {
wx.showToast({
icon: 'none',
title: `切换至第${event.detail}项`
});
}
});
```
### 提示气泡(暂未实现)
设置`dot`属性后,会在右上角展示一个小红点。设置`info`属性后,会在右上角展示相应的徽标
```html
<wr-sidebar active-key="{{ activeKey }}">
<wr-sidebar-item title="标签名称" dot />
<wr-sidebar-item title="标签名称" info="5" />
<wr-sidebar-item title="标签名称" info="99+" />
</wr-sidebar>
```
## API
### Sidebar Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|-----------|-----------|-----------|-------------|-------------|
| activeKey | 选中项的索引 | *string \| number* | `0` | - |
### Sidebar Event
| 事件名 | 说明 | 参数 |
|------|------|------|
| change | 切换选项时触发 | 当前选中选项的索引 |
### Sidebar 外部样式类
| 类名 | 说明 |
|-----------|-----------|
| custom-class | 根节点样式类 |
### SidebarItem Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|-----------|-----------|-----------|-------------|-------------|
| title | 内容 | *string* | `''` | - |
| disabled | 是否禁用 | | *boolean* | `false` | - |
| dot | 是否显示右上角小红点 | *boolean* | `false` | - |
| info | 提示消息 | *string \| number* | `''` | - |
### SidebarItem Event
| 事件名 | 说明 | 参数 |
|------|------|------|
| click | 点击徽章时触发 | 当前徽章的索引 |
### SidebarItem 外部样式类
| 类名 | 说明 |
|-----------|-----------|
| custom-class | 根节点样式类 |
没有合适的资源?快使用搜索试试~ 我知道了~
基于微信小程序的零售行业模版小程序.zip
共403个文件
js:140个
json:81个
wxss:79个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 38 浏览量
2024-02-21
20:44:15
上传
评论
收藏 397KB ZIP 举报
温馨提示
基于微信小程序开发的系统
资源推荐
资源详情
资源评论
收起资源包目录
基于微信小程序的零售行业模版小程序.zip (403个子文件)
commit-msg 91B
index.js 445KB
good.js 47KB
api.js 41KB
orderDetail.js 34KB
orderList.js 34KB
index.js 16KB
index.js 12KB
comments.js 12KB
index.js 11KB
cart.js 11KB
index.js 9KB
index.js 9KB
index.js 9KB
index.js 8KB
applyService.js 7KB
index.js 6KB
category.js 6KB
index.js 6KB
index.js 6KB
index.js 6KB
index.js 6KB
index.js 6KB
index.js 5KB
index.js 5KB
index.js 5KB
index.js 5KB
index.js 5KB
index.js 5KB
index.js 5KB
index.js 4KB
selectCoupons.js 4KB
.eslintrc.js 4KB
orderConfirm.js 4KB
pay.js 4KB
index.js 4KB
util.js 3KB
index.js 3KB
index.js 3KB
index.js 3KB
index.js 3KB
config.js 3KB
home.js 3KB
index.js 2KB
index.js 2KB
index.js 2KB
eslintCheck.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
applyService.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
orderConfirm.js 1KB
index.js 1KB
index.js 1KB
noGoods.js 1KB
submitComment.js 1KB
queryDetail.js 1KB
index.js 1KB
index.js 1KB
api.js 1KB
getPermission.js 1KB
fetchAddress.js 1KB
index.js 1KB
index.js 1KB
index.js 1KB
index.js 1KB
index.js 1KB
swiper.js 1KB
index.js 1KB
index.js 1KB
fetchGoodsDetailsComments.js 1KB
coupon.js 1KB
home.js 1KB
search.js 1KB
index.js 1KB
index.js 1024B
fetchGoodsList.js 978B
orderDetail.js 972B
index.js 966B
fetchSearchResult.js 966B
orderList.js 953B
index.js 938B
mock.js 917B
index.js 891B
index.js 887B
usercenter.js 872B
fetchSearchHistory.js 869B
index.js 835B
address.js 815B
fetchGoods.js 814B
index.js 796B
detailsComments.js 786B
api.js 777B
util.js 774B
共 403 条
- 1
- 2
- 3
- 4
- 5
资源评论
我慢慢地也过来了
- 粉丝: 7479
- 资源: 4013
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- AutoHotKey 2.0中文帮助文件
- 基于Docker-compose的Elasticsearch集群每个节点均是独立docker-compose配置而成源码.zip
- 目标检测-零售食品LOGO检测数据集-40000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-30000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-20000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-10000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 基于GUI+MYSQL+JAVA图书管理系统文档说明+源码(高分大作业项目).zip
- 基于Qt使用C++实现图书管理系统源码+数据库(95分以上).zip
- 基于GUI+MYSQL+JAVA票务管理系统文档介绍+源码+数据库(高分大作业).zip
- Java项目-购物网站系统(java+Servlet+JSP+Mysql)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功