splitpane.vue 1.3 KB
Newer Older
P
add  
Pan 已提交
1
<template>
P
Pan 已提交
2
	<div class="components-container">
P
refine  
Pan 已提交
3 4
		<code>splitPane 如果你用过<a href='http://codepen.io/' target='_blank'> codepen</a>,<a href='https://jsfiddle.net/' target='_blank'> jsfiddle </a>就不会陌生了
      <a href='https://github.com/PanJiaChen/vue-split-pane' target='_blank'>项目地址</a>
P
add  
Pan 已提交
5
      </code>
P
Pan 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
		<split-pane v-on:resize="resize" split="vertical">
			<template slot="paneL">
				<div class="left-container"></div>
			</template>
			<template slot="paneR">
				<split-pane split="horizontal">
					<template slot="paneL">
						<div class="top-container"></div>
					</template>
					<template slot="paneR">
						<div class="bottom-container">
						</div>
					</template>
				</split-pane>
			</template>
		</split-pane>
	</div>
P
add  
Pan 已提交
23 24 25
</template>

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

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

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

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

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

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

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