更新记录
1.0.0(2023-04-08)
下载此版本
简单的通用商城列表页面模板
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
× |
× |
√ |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
鸿蒙元服务 |
× |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
× |
× |
× |
× |
× |
建议
按照使用方法,各个dom元素都加上100%
组件属性
属性名 |
属性内容 |
示例 |
menuList |
侧边栏列表 |
查看使用方法中的案例 |
goodsList |
商品列表 |
查看使用方法中的案例 |
more |
商品列表触底文字 |
查看使用方法中的案例 |
组件事件
事件名 |
事件内容 |
示例 |
@menuChange |
侧边栏改变事件 |
查看使用方法中的案例 |
@add |
商品加入事件 |
查看使用方法中的案例 |
@getMore |
触底加载更多事件 |
查看使用方法中的案例 |
使用方法
<template>
<view class="home">
<yhdslShopList style="height: 100%;" :menuList="menuList" :goodsList="goodsList" :more="more" @add="add" @menuChange="menuChange" @getMore="getMore"></yhdslShopList>
</view>
</template>
<script>
import yhdslShopList from '@/components/yhdsl-shopList/yhdsl-shopList.vue';
export default {
data() {
return {
more: '加载中...',
menuList: [
{
id: 1,
name: '漫画书'
},
{
id: 2,
name: '科幻小说'
},
{
id: 3,
name: '名人传'
}
],
goodsList: [
{
id: 1,
name: '西游记',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 2,
name: '三体',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 3,
name: '好好好好',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 1000,
unit: '堆'
},
{
id: 1,
name: '西游记',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 2,
name: '三体',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 3,
name: '好好好好',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 1000,
unit: '堆'
},
{
id: 1,
name: '西游记',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 2,
name: '三体',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 100,
unit: '本'
},
{
id: 3,
name: '好好好好',
cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
type: '玄幻',
time: '24小时发售',
new: 50,
old: 1000,
unit: '堆'
}
]
};
},
components: {
yhdslShopList
},
methods: {
menuChange(item) {
console.log(item);
},
add(item) {
console.log(item);
},
getMore() {
console.log('触发加载更多事件');
}
}
};
</script>
<style>
page {
height: 100%;
}
</style>
<style scoped lang="scss">
.home {
height: 100%;
}
</style>