Vue 2 Split Pane Component

1.0.6 · maintenance · verified Tue Apr 21

Vue Split Pane is a component designed for Vue 2 applications, enabling the creation of resizable split panels either vertically or horizontally. It provides a straightforward way to divide layout space into two adjustable panes, which can also be nested for more complex layouts. The package is currently at version 1.0.6, with the last notable activity (according to provided snippets) in 2022, primarily focused on minor bug fixes and feature enhancements like emitting current percent values. Given its exclusive support for the End-of-Life (EOL) Vue 2 framework, its release cadence is effectively ceased, and it should be considered in a maintenance or abandoned state. Its key differentiator is its simplicity and direct compatibility with legacy Vue 2 projects requiring basic split-pane functionality without migrating to newer frameworks or complex libraries.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates global registration of `split-pane`, its basic usage with vertical splitting, and a nested horizontal split pane. It includes a `resize` event handler and dynamic percentage display.

import Vue from 'vue';
import splitPane from 'vue-splitpane';

// Register as a global component
Vue.component('split-pane', splitPane);

new Vue({
  el: '#app',
  data: {
    percentL: 30,
    percentR: 70
  },
  methods: {
    resize(newPercent) {
      console.log('Pane resized to:', newPercent);
      this.percentL = newPercent;
      this.percentR = 100 - newPercent;
    }
  },
  template: `
    <div style="height: 500px; width: 100%; border: 1px solid #eee;">
      <split-pane @resize="resize" :min-percent="20" :default-percent="percentL" split="vertical">
        <template slot="paneL">
          <div style="padding: 20px; text-align: center; background: #f0f2f5;">
            Left Pane ({{ percentL.toFixed(1) }}%)
            <p>This pane resizes horizontally.</p>
          </div>
        </template>
        <template slot="paneR">
          <split-pane split="horizontal">
            <template slot="paneL">
              <div style="padding: 20px; text-align: center; background: #e6f7ff;">
                Right Top Pane
                <p>This nested pane resizes vertically.</p>
              </div>
            </template>
            <template slot="paneR">
              <div style="padding: 20px; text-align: center; background: #fffbe6;">
                Right Bottom Pane
              </div>
            </template>
          </split-pane>
        </template>
      </split-pane>
    </div>
  `
});

view raw JSON →