Skip to content

Divider Component

A dividing line used to separate content, commonly used for the "no more" hint at the bottom of a page

📌Platform Compatibility

APP(vue)H5WeChat Mini ProgramAlipay Mini Program

🏯Basic Usage

html
<!-- 全局使用 -->
<hy-divider text="分割"></hy-divider>

Setting a Dashed Line

  • Use dashed to specify a dashed line
html
<template>
    <hy-divider text="月落" dashed></hy-divider>
</template>

Setting a Hairline

  • Use hairline to specify a thin line
html
<template>
    <!--细线-->
    <hy-divider text="月落" hairline></hy-divider>
    <!--粗线-->
    <hy-divider text="月落" :hairline="false"></hy-divider>
</template>

Using a Dot Instead of Text

  • Use dot to replace the text with a dot
html
<template>
    <hy-divider dot></hy-divider>
</template>

Setting Text Alignment

  • Use textPosition to specify whether the text is aligned left or right
    • left: text aligned to the left
    • center: text centered (default)
    • right: text aligned to the right
html
<template>
    <hy-divider text="月落" textPosition="left"></hy-divider>
    <hy-divider text="月落" textPosition="right"></hy-divider>
</template>

Setting Text Color and Line Color

  • Use textColor and lineColor to specify the text color and line color
html
<template>
    <hy-divider text="月落" textColor="#2979ff" lineColor="#ff0000"></hy-divider>
</template>

API

Divider Props

ParameterDescriptionTypeDefault
textText contentstring|loadMore| loading|noMore-
dashedWhether to use a dashed linebooleanfalse
hairlineWhether to use a hairline (thin line)booleantrue
dotWhether to use a dot instead of text; takes precedence over the text fieldbooleanfalse
textPositionPosition of the text contentcenter|left|rightcenter
textSizeText size; numeric values default to pxstring | number14
textColorText colorstring#909399
lineColorLine colorstring#dcdfe6
loadingIconIcon for the loading statestringLOADING
loadMoreTextPrompt text shown before loadingstringLoad more
loadingTextPrompt text shown while loadingstringLoading...
noMoreTextPrompt text shown when there is no more contentstringNo more data
marginTopDistance from the previous element; numeric values default to pxstring | number0
marginBottomDistance from the next element; numeric values default to pxstring | number0
customStyleCustom external styles to be appliedCSSProperties-
customClassCustom external class namestring-

Events

Event NameDescriptionCallback Parameters
clickClick event-
03:29