其他组件

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

示例代码

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

  1. <view class="page__hd">
  2. <view class="page__title">Flex</view>
  3. <view class="page__desc">Flex布局</view>
  4. </view>
  5. <view class="page__bd page__bd_spacing">
  6. <view class="weui-flex">
  7. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  8. </view>
  9. <view class="weui-flex">
  10. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  11. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  12. </view>
  13. <view class="weui-flex">
  14. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  15. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  16. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  17. </view>
  18. <view class="weui-flex">
  19. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  20. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  21. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  22. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  23. </view>
  24. <view class="weui-flex">
  25. <view><view class="placeholder">weui</view></view>
  26. <view class="weui-flex__item"><view class="placeholder">weui</view></view>
  27. <view><view class="placeholder">weui</view></view>
  28. </view>
  29. </view>

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

flex布局

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