Commit abb8a936 by 张立顺

fix 样式宽度调整

1 parent 99e8d630
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
* 使用方需提供: $refs.headerRow (表头 tr), $refs.bodyTable (表体 table) * 使用方需提供: $refs.headerRow (表头 tr), $refs.bodyTable (表体 table)
*/ */
const MIN_COL_WIDTH = 80; const MIN_COL_WIDTH = 80;
const MAX_COL_WIDTH = 400; const MAX_COL_WIDTH = 800;
const RESIZE_DELTA_SCALE = 2;
export default { export default {
data() { data() {
...@@ -111,7 +112,7 @@ export default { ...@@ -111,7 +112,7 @@ export default {
this._resizeState = { index, startX, startWidth, minW, maxW }; this._resizeState = { index, startX, startWidth, minW, maxW };
this._onResizeMove = (ev) => { this._onResizeMove = (ev) => {
const delta = ev.clientX - startX; const delta = (ev.clientX - startX) * RESIZE_DELTA_SCALE;
let newWidth = Math.round(startWidth + delta); let newWidth = Math.round(startWidth + delta);
newWidth = Math.max(minW, Math.min(maxW, newWidth)); newWidth = Math.max(minW, Math.min(maxW, newWidth));
this.$set(this.columnWidths, index, newWidth); this.$set(this.columnWidths, index, newWidth);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!