zydx-plus 1.35.635 → 1.35.636

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.635",
3
+ "version": "1.35.636",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -101,12 +101,12 @@ export default {
101
101
  // 获取Dom节点
102
102
  const boxDom = this.$refs.boxRef,
103
103
  leftDom = this.$refs.leftRef,
104
- resizeDom = this.$refs.resizeRef,
105
- rightDom = this.$refs.rightRef;
104
+ resizeDom = this.$refs.resizeRef;
106
105
  if (resizeDom) {
107
106
  // 使用 .resize div 的实际宽度(10px)而非 img 宽度(30px),避免拖动位置偏左
108
107
  const resizeWidth = resizeDom.parentElement.offsetWidth
109
- const maxWidth = boxDom.clientWidth - resizeWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
108
+ const containerWidth = boxDom.clientWidth
109
+ const maxWidth = containerWidth - resizeWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
110
110
  resizeDom.onmousedown = e => {
111
111
  const startX = e.clientX; // 记录坐标起始位置
112
112
  const startLeft = leftDom.offsetWidth; // 左边元素起始宽度
@@ -121,9 +121,10 @@ export default {
121
121
  if (moveLen > maxWidth - this.rightMinWidth) {
122
122
  moveLen = maxWidth - this.rightMinWidth;
123
123
  }
124
- // 拖动时更新 data 属性(响应式绑定到 :style),避免与模板样式冲突
125
- this.leftWidth = (moveLen / maxWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
126
- this.rightWidth = ((maxWidth - moveLen) / maxWidth) * 100 + "%"; // 右边区域 = 总大小 - 左边宽度 - 拖动条宽度
124
+ // 百分比基准用完整容器宽,右侧再减去 resize 宽度,
125
+ // 保证 left% + right% + resize(10px) = 100%,避免拖拽后总宽多出 10px
126
+ this.leftWidth = (moveLen / containerWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
127
+ this.rightWidth = ((containerWidth - moveLen - resizeWidth) / containerWidth) * 100 + "%"; // 右边区域 = 容器 - 左边宽度 - 拖动条宽度
127
128
  };
128
129
  document.onmouseup = () => {
129
130
  document.onmousemove = null;
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.635',
90
+ version: '1.35.636',
91
91
  install,
92
92
  Calendar,
93
93
  Message,