运行如下的命令,基于 master 分支在本地创建 cate 子分支,用来开发分类页面相关的功能:
git checkout -b cate
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
xxx
测试结果如下:
获取到的数据示例如下:
{
"message": [
{
"cat_id": 1,
"cat_name": "大家电",
"cat_pid": 0,
"cat_level": 0,
"cat_deleted": false,
"cat_icon": "",
"children": [
{
"cat_id": 3,
"cat_name": "电视",
"cat_pid": 1,
"cat_level": 1,
"cat_deleted": false,
"cat_icon": "",
"children": [
{
"cat_id": 5,
"cat_name": "曲面电视",
"cat_pid": 3,
"cat_level": 2,
"cat_deleted": false,
"cat_icon": "https://api-hmugo-web.itheima.net/full/2fb113b32f7a2b161f5ee4096c319afedc3fd5a1.jpg"
}
]
}
]
}
],
"meta": {
"msg": "获取成功",
"status": 200
}
}
返回参数说明
参数名 | 类型 | |
cat_id | int | 分类id |
cat_name | string | 分类名称 |
children | array | 子节点 |
cat_icon | string | 图标 |
{{item.cat_name}}
{{item.cat_name}}
{{item.cat_name}}
...
{{item2.cat_name}}
...
/ {{item2.cat_name}} /
{{item3.cat_name}}
测试效果如下:
图片url无法访问,出现问题,暂未解决
// 左侧选中项改变事件处理
activeChanged(i) {
this.active = i
this.cateLevel2 = this.cateList[i].children
// 让 scrollTop 在 0 和 1 之间切换
this.scrollTop = this.scrollTop ? 0 : 1
}
git add .
git commit -m "完成了分类页面的开发"
git push -u origin cate
git checkout master
git merge cate
git push -u origin cate
git branch -d cate
页面更新:2024-04-22
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号