Socket
Socket
Sign inDemoInstall

@swivel-admin/vue-multi-split-pane

Package Overview
Dependencies
10
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @swivel-admin/vue-multi-split-pane

A component based on Vue.js. Provides unlimited resizable multi pane support.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.2.0

Added

  • Now we can use initWidth and initHeight props to set initial width or height for Pane component.

Readme

Source

Vue Multi Split Pane

A component based on Vue.js. Provides unlimited resizable multi pane support.

Demo

Live Demo | Codesandbox | JSFiddle | Codepen

Install

npm i vue-multi-split-pane

Browser

<script src="https://unpkg.com/vue-multi-split-pane"></script>

Example

import { MultiSplitPane, Pane } from 'vue-multi-split-pane'

export default {
  components: {
    MultiSplitPane,
    Pane
  },
  methods: {
    onPaneCollapsed(paneIndex, paneClass, containerClass) {
      console.log(
        `${paneIndex}. pane collapsed. Pane class: '${paneClass}' MultiSplitPane class: '${containerClass}'`
      )
    },
    onPaneExpanded(paneIndex, paneClass, containerClass) {
      console.log(
        `${paneIndex}. pane expanded. Pane class: '${paneClass}' MultiSplitPane class: '${containerClass}'`
      )
    }
  }
}
<MultiSplitPane
  split="horizontal"
  height="400px"
  width="1000px"
  resizerWidth="30px"
  classes="v-pane-custom"
  @onPaneCollapsed="onPaneCollapsed"
  @onPaneExpanded="onPaneExpanded"
>
  <Pane>
    <template v-slot:resizer>
      resizer slot
    </template>
    <template v-slot:content>
      Content 1
    </template>
  </Pane>
  <Pane>
    <template v-slot:content>
      Content 2
    </template>
  </Pane>
  <Pane>
    <template v-slot:content>
      Content 3
    </template>
  </Pane>
</MultiSplitPane>

Nested Pane Example

<MultiSplitPane
  split="horizontal"
  height="400px"
  width="1000px"
  resizerWidth="30px"
  :nested="true"
  classes="v-pane-custom"
>
  <Pane>
    <template v-slot:content>
      Lorem, ipsum dolor sit amet consectetur adipisicing elit.
    </template>
  </Pane>
  <Pane classes="paneNested">
    <template v-slot:content>
      <MultiSplitPane
        height="400px"
        resizerWidth="30px"
        classes="v-pane-custom"
      >
        <Pane>
          <template v-slot:content>
            Lorem, ipsum dolor sit amet consectetur adipisicing elit.
          </template>
        </Pane>
        <Pane>
          <template v-slot:content>
            Lorem, ipsum dolor sit amet consectetur adipisicing elit.
          </template>
        </Pane>
      </MultiSplitPane>
    </template>
  </Pane>
</MultiSplitPane>

Initial Width Example

Also initHeight props is available for vertical split.

<MultiSplitPane
  split="horizontal"
  height="400px"
  width="1000px"
  resizerWidth="30px"
  classes="v-pane-custom"
>
  <Pane initWidth="75%">
    <template v-slot:content>
      Lorem, ipsum dolor sit amet consectetur adipisicing elit. Consectetur,
      excepturi in dolores accusantium praesentium quidem laborum neque ut ipsum
      veritatis ratione rem, esse totam voluptates ullam nesciunt tempora
      architecto laudantium!
    </template>
  </Pane>
  <Pane initWidth="25%">
    <template v-slot:content>
      Lorem, ipsum dolor sit amet consectetur adipisicing elit. Consectetur,
      excepturi in dolores accusantium praesentium quidem laborum neque ut ipsum
      veritatis ratione rem, esse totam voluptates ullam nesciunt tempora
      architecto laudantium!
    </template>
  </Pane>
</MultiSplitPane>

Props

PropDescriptionvaluedefault
splitOrientation of the MultiSplitPanevertical, horizontalvertical
widthWidth of the MultiSplitPaneString100%
heightHeight of the MultiSplitPaneStringauto
resizerWidthWidth/height of the resizers. Valid for horizontal and vertical orientation.String30px
classesCustom class prop. Can be send to MultiSplitPane or PaneStringnone
:nestedWill you use nested MultiSplitPane? Then should be true.Booleanfalse
initWidthCan be used to set initial width for specific Pane component.Stringundefined
initHeightCan be used to set initial height for specific Pane component.Stringundefined

Events

EventDescription
onPaneCollapsed ( paneIndex, paneClass, containerClass )Event will be fired when collapsed any pane. Used on MultiSplitPane
onPaneExpanded ( paneIndex, paneClass, containerClass )Event will be fired when expanded any pane. Used on MultiSplitPane

Keywords

FAQs

Last updated on 10 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc