https://developers.weixin.qq.com/miniprogram/dev/extended/weui/slideview.html
// index.wxml
<view class="weui-cells">
<mp-slideview ext-class="slideViewClass" buttons="{{slideButtons}}" bindbuttontap="slideButtonTap">
<mp-cell value="标题文字"></mp-cell>
</mp-slideview>
</view>
// index.json
{
"usingComponents": {
"mp-slideview": "weui-miniprogram/slideview/slideview",
"mp-cell": "weui-miniprogram/cell/cell",
}
}
// index.js
data: {
slideButtons: [
{
text: "收藏",
src: '/page/replay.svg', // icon的路径
},
{
text: "点赞",
src: '/page/replay.svg', // icon的路径
},
{
text: "删除",
src: '/page/replay.svg', // icon的路径
}]
}
// app.json
"useExtendedLib": {
"weui": true
}
发现是我用的基础版本库不对,在开发工具右上角的【详情】-【本地设置】中选择较新的基础版本库(我选的是2.19.1)就好了
// index.wxml
// index.wxml
<mp-slideview data-id="{{item.id}}" buttons="slideButtons" bindbuttontap="onSlideButtonTap"></mp-slideview>
// index.json
"usingComponents": {
"mp-slideview": "weui-miniprogram/slideview/slideview"
}
// app.json
"useExtendedLib": {
"weui": true
}