更新记录
1.0.0(2025-04-17)
下载此版本
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.97 app-vue |
× |
√ |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
鸿蒙元服务 |
× |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
× |
√ |
√ |
√ |
o-layout
用于组织页面的框架结构
使用方法
<o-layout>
容器,可包裹子组件<o-header>
、<o-footer>
、<o-aside>
、<o-main>
。
当子元素中包含 <o-aside>
时,全部子元素会水平(左右)排列,否则会垂直(上下)排列。
<template>
<o-layout>
<o-header>header</o-header>
<o-main>main</o-main>
<o-footer>footer</o-footer>
</o-layout>
</template>
<template>
<o-layout height="100vh">
<o-aside class="br-solid-1">1</o-aside>
<o-main class="bg-gray-10">
……
</o-main>
</o-layout>
</template>
<template>
<o-layout height="100vh">
<o-aside width="80px">123</o-aside>
<o-layout>
<o-header class="bb-solid-1">header</o-header>
<o-layout height="calc(100vh - 57px)">
<o-aside width="20vw" trans>
……
</o-aside>
<o-main class="bg-gray-10 px-4 py-3">
……
</o-main>
</o-layout>
</o-layout>
</o-layout>
</template>
API
o-layout 容器
属性名 |
类型 |
默认值 |
说明 |
height |
String |
100% |
高度,style模式,支持calc公式 |
o-header 页头
属性名 |
类型 |
默认值 |
说明 |
height |
String |
56px |
高度,style模式,支持calc公式 |
o-aside 侧边栏
属性名 |
类型 |
默认值 |
说明 |
width |
String |
100% |
宽度,style模式,支持calc公式 |
height |
String |
100% |
高度,style模式,支持calc公式 |
trans |
Boolean |
false |
是否显示侧栏伸缩开关 |
o-main 主内容
属性名 |
类型 |
默认值 |
说明 |
height |
String |
100% |
高度,style模式,支持calc公式 |
o-footer 页脚
属性名 |
类型 |
默认值 |
说明 |
height |
String |
50px |
高度,style模式,支持calc公式 |