For vue-gutter-resize, you can change the size of both neighbor dom by dragging gutter.
言語 : en
vue-gutter-resizeは、gutterをドラッグすると両隣のdomのサイズを変更できます。
Chrome | Safari |
---|---|
last version | last version |
yarn add vue-gutter-resize
# or
npm i vue-gutter-resize
import Vue from 'vue/dist/vue.esm.js'
import VueGutterResize from 'vue-gutter-resize'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
Vue.use(VueGutterResize)
import { ColumnGutter } from 'vue-gutter-resize'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
// umd module
import { ColumnGutter } from 'vue-gutter-resize/dist/vue-gutter-resize.umd.js'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
// commonjs module
import { ColumnGutter } from 'vue-gutter-resize/dist/vue-gutter-resize.js'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
<template>
<column-gutter
:column="column"
:width="'100vw'"
:height="'600px'"
:gutter-sizes="['4px', '1rem', '1em']"
:colors="colors"
:column-sizes="[4, 1, 4, 1]"
@resize="resize">
<div slot="col-0">0</div>
<div slot="col-1">1</div>
<div slot="col-2">2</div>
<div slot="col-3">3</div>
</column-gutter>
</template>
<script>
import { ColumnGutter } from 'vue-gutter-resize'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
export default {
components: {
ColumnGutter
},
data () {
return {
column: 4,
colors: ['red', 'blue', 'yellow']
}
},
methods: {
resize ({ col }) {
console.log(col) // current col size (etc... [25, 25, 25, 25]
}
}
}
</script>
<template>
<row-gutter
style="border: 1px solid #ccc;"
:row="row"
:width="'800px'"
:height="'600px'"
:gutter-size="'4px'"
:colors="colors"
:row-sizes="[1, 2, 3, 4]"
@resize="resize">
<div slot="row-0">0</div>
<div slot="row-1">1</div>
<div slot="row-2">2</div>
<div slot="row-3">3</div>
</row-gutter>
</template>
<script>
import { RowGutter } from 'vue-gutter-resize'
import 'vue-gutter-resize/dist/vue-gutter-resize.css'
export default {
components: {
RowGutter
},
data () {
return {
row: 4,
colors: ['red', 'blue', 'yellow']
}
},
methods: {
resize ({ row }) {
console.log(row) // current row size (etc... [25, 25, 25, 25]
}
}
}
</script>
String
:width="'800px'"
String
:height="'600px'"
String
:gutter-size="'4px'"
Array<String>
:gutter-sizes="['7px', '1rem']"
String
:color="'green'"
Array<String>
:colors="['red', 'blue']"
Number
:column="3"
Array<Number>
:column-sizes="[1, 2, 3]"
Object
Array<Number>
col-nで指定
<div slot="col-0">1つ目のcolumn</div>
<div slot="col-1">2つ目のcolumn</div>
<div slot="col-2">3つ目のcolumn</div>
String
:width="'800px'"
String
:height="'600px'"
String
:gutter-size="'4px'"
Array<String>
:gutter-sizes="['7px', '1rem']"
String
:color="'green'"
Array<String>
:colors="['red', 'blue']"
Number
:row="3"
Array<Number>
:row-sizes="[1, 2, 3]"
Object
Array<Number>
row-nで指定
<div slot="row-0">1つ目のrow</div>
<div slot="row-1">2つ目のrow</div>
<div slot="row-2">3つ目のrow</div>
https://github.com/tomatoaiu/vue-gutter-resize-example