微信小程序 WeUI·其他组件

其他组件

出于性能考虑,weui-miniprogram 并没有对所有 WeUI 组件进行封装(如:flex布局组件),可以直接使用 WeUI 中定义的组件结构(参考 Demo)。

示例代码

在引入 weui.wxss 后,可以直接使用 weui-wxss 中定义的 class 自定义样式,以 flex 组件为例:

<view class="page__hd">
    <view class="page__title">Flex</view>
    <view class="page__desc">Flex布局</view>
</view>
<view class="page__bd page__bd_spacing">
    <view class="weui-flex">
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
    </view>
    <view class="weui-flex">
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
    </view>
    <view class="weui-flex">
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
    </view>
    <view class="weui-flex">
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
    </view>
    <view class="weui-flex">
        <view><view class="placeholder">weui</view></view>
        <view class="weui-flex__item"><view class="placeholder">weui</view></view>
        <view><view class="placeholder">weui</view></view>
    </view>
</view>

渲染到页面上会得到以下结果:

其他组件可以参考库中提供的 Demo

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《微信小程序 WeUI·其他组件》
文章链接:https://zhuji.vsping.com/309864.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。