Skip to content

Split 分割面板

介绍

Split 分割面板组件可以将一个区域分割为多个可调整尺寸的面板。

基础用法

vue
<template>
  <yc-split style="height: 300px;">
    <template #first>
      <div style="padding: 20px; background: #f5f5f5;">
        左侧面板
      </div>
    </template>
    <template #second>
      <div style="padding: 20px; background: #fafafa;">
        右侧面板
      </div>
    </template>
  </yc-split>
</template>

垂直分割

vue
<template>
  <yc-split direction="vertical" style="height: 300px;">
    <template #first>
      <div style="padding: 20px; background: #f5f5f5;">
        上方面板
      </div>
    </template>
    <template #second>
      <div style="padding: 20px; background: #fafafa;">
        下方面板
      </div>
    </template>
  </yc-split>
</template>

API

Split Props

参数名描述类型默认值
direction分割方向'horizontal' | 'vertical''horizontal'
size第一个面板的尺寸number | string0.5
min第一个面板的最小尺寸number | string0
max第一个面板的最大尺寸number | string1

Released under the MIT License.