splitpane.vue 1.5 KB
Newer Older
P
add  
Pan 已提交
1
<template>
P
Pan 已提交
2
  <div class="components-container">
花裤衩 已提交
3
    <code><strong>SplitPane</strong> If you've used
P
Pan 已提交
4
      <a href="http://codepen.io/" target="_blank"> codepen</a>,
花裤衩 已提交
5
      <a href="https://jsfiddle.net/" target="_blank"> jsfiddle </a>will not be unfamiliar.
6
      <a href="https://github.com/PanJiaChen/vue-split-pane" target="_blank"> Github repository</a>
P
Pan 已提交
7
    </code>
8
    <split-pane split="vertical" @resize="resize">
P
Pan 已提交
9
      <template slot="paneL">
J
Jere 已提交
10
        <div class="left-container" />
P
Pan 已提交
11 12 13 14
      </template>
      <template slot="paneR">
        <split-pane split="horizontal">
          <template slot="paneL">
J
Jere 已提交
15
            <div class="top-container" />
P
Pan 已提交
16 17
          </template>
          <template slot="paneR">
J
Jere 已提交
18
            <div class="bottom-container" />
P
Pan 已提交
19 20 21 22 23
          </template>
        </split-pane>
      </template>
    </split-pane>
  </div>
P
add  
Pan 已提交
24 25 26
</template>

<script>
P
refine  
Pan 已提交
27
import splitPane from 'vue-splitpane'
P
Pan 已提交
28

P
Pan 已提交
29
export default {
30
  name: 'SplitpaneDemo',
P
Pan 已提交
31 32 33 34
  components: { splitPane },
  methods: {
    resize() {
      console.log('resize')
P
Pan 已提交
35
    }
P
Pan 已提交
36 37
  }
}
P
add  
Pan 已提交
38
</script>
P
Pan 已提交
39

P
add  
Pan 已提交
40
<style  scoped>
41 42 43 44
  .components-container {
    position: relative;
    height: 100vh;
  }
P
add  
Pan 已提交
45

46 47 48 49
  .left-container {
    background-color: #F38181;
    height: 100%;
  }
P
add  
Pan 已提交
50

51 52 53 54
  .right-container {
    background-color: #FCE38A;
    height: 200px;
  }
P
add  
Pan 已提交
55

56 57 58 59 60
  .top-container {
    background-color: #FCE38A;
    width: 100%;
    height: 100%;
  }
P
Pan 已提交
61

62 63 64 65 66
  .bottom-container {
    width: 100%;
    background-color: #95E1D3;
    height: 100%;
  }
P
add  
Pan 已提交
67
</style>