抽屉侧滑菜单是一种非常流行的UI布局方式。
在微信小程序中,如何实现抽屉侧滑菜单呢?
如果是使用uniapp开发微信小程序,就非常简单了。uniapp提供了一个抽屉侧滑菜单组件。
先去插件市场(https://ext.dcloud.net.cn/plugin?name=uni-drawer),点击安装组件。
使用如下:
<template>
<view>
<button @click="showDrawer" type="primary">右侧弹出 显示Drawer</button>
<uni-drawer ref="showRight" mode="right" :mask-click="false">
<scroll-view style="height: 100%;" scroll-y="true">
<button @click="closeDrawer" type="primary">关闭Drawer</button>
<view v-for="item in 60" :key="item">可滚动内容 {{ item }}</view>
</scroll-view>
</uni-drawer>
</view>
</template>
<script>
export default {
methods: {
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
}
}
}
</script>
更详细的使用方法可参考文档:https://uniapp.dcloud.io/component/uniui/uni-drawer.html
-
aria-component 微信小程序无障碍访问组件aria-component是一个微信小程序无障碍访问组件,满足视障人士对于小程序的访问需求。
-
LivePlayerContext.startCasting 微信小程序投屏接口微信小程序v2.32.0增加了投屏接口LivePlayerContext.startCasting,开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用。
-
微信小程序怎么获取不了手机号微信小程序无法获取手机号,可以看看是不是以下情况。
-
微信小程序开源框架市面上有很多优秀的微信小程序开源框架,常见的多半是前端框架,比如:vant-weapp、wux-weapp、Taro等等。
-
微信小程序实时音视频播放组件 live-player微信小程序实时音视频播放组件live-player v2.9.1 起支持同层渲染。
-
插件中发起支付API(微信小程序)wx.requestPluginPaymentwx.requestPluginPayment是微信小程序插件中发起支付API。
暂无评论,抢个沙发...