Divider 分割线
分隔相邻内容,支持文字和竖向形式。
引入
uni-app 配置 easycom 后使用 <hui-divider>;公开类型从 @nscode/handy-uni 导入。普通 Vue 3 项目安装 @nscode/handy-uni/web 预览版插件后使用同名组件。
示例
操作控件后,页面直接显示当前值和事件结果。
vue
<template>
<view>
<hui-divider>分区 / Section</hui-divider>
<hui-divider content-position="left">left</hui-divider
><hui-divider content-position="right" border-style="dashed">right / dashed</hui-divider
><hui-divider border-style="dotted" /><view
><text>A</text><hui-divider direction="vertical" /><text>B</text></view
>
<text>{{ lastEvent }}</text>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const lastEvent = ref('尚无事件')
</script>
Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
direction | "vertical" | "horizontal" | 'horizontal' | 和 PC 同名 |
contentPosition | "left" | "right" | "center" | 'center' | 和 PC 同名 |
borderStyle | "solid" | "dashed" | "dotted" | 'solid' | 和 PC 同名 |
hairline | boolean | true | 0.5px 细线(总体设计 9.9 的 mixin) |
根节点属性见通用属性。布尔默认值为 undefined 时支持继承;显式 false 会覆盖继承值。其他布尔值按表中默认值处理。
borderStyle="dashed" 与 hairline 同时使用时,细线缩放会让虚线间距变小。
Events
无。
Slots
| 插槽 | 参数 | 说明 |
|---|---|---|
default | — | 主体内容。 |
方法
无。
类型
DividerProps 可从 @nscode/handy-uni 导入。
平台说明
| 行为 | uni-app H5 | 微信小程序 | App-vue | 普通 Vue 3 Web(预览) |
|---|---|---|---|---|
| 基本交互 | 已实现,待设备复核 | 已实现,待设备复核 | 已实现,待设备复核 | 由 Web 平台适配层实现 |
设备操作见冒烟清单。真实设备读数单独记录,单元测试通过不代表真机验收。