bkui-vue 2.0.2-beta.89 → 2.0.2-beta.90
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/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +4 -5
- package/dist/index.umd.js +2 -2
- package/lib/index.js +1 -1
- package/lib/sideslider/index.js +5 -8
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/sideslider/index.js
CHANGED
|
@@ -607,7 +607,7 @@ sliderProps.width["default"] = '400';
|
|
|
607
607
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
|
608
608
|
resolveClassName = _usePrefix.resolveClassName;
|
|
609
609
|
// 拖拽相关状态
|
|
610
|
-
var currentWidth = (0,external_vue_namespaceObject.ref)(
|
|
610
|
+
var currentWidth = (0,external_vue_namespaceObject.ref)(props.width);
|
|
611
611
|
// 代理线
|
|
612
612
|
var resizeProxyRef = (0,external_vue_namespaceObject.ref)(null);
|
|
613
613
|
// 遮罩
|
|
@@ -706,10 +706,8 @@ sliderProps.width["default"] = '400';
|
|
|
706
706
|
emit('before-resize', mouseEvent);
|
|
707
707
|
var rect = (_modalWrapperRef$valu = modalWrapperRef.value) === null || _modalWrapperRef$valu === void 0 ? void 0 : _modalWrapperRef$valu.getBoundingClientRect();
|
|
708
708
|
if (!rect) return;
|
|
709
|
-
//
|
|
710
|
-
|
|
711
|
-
currentWidth.value = rect.width;
|
|
712
|
-
}
|
|
709
|
+
// 拖拽开始时,将 currentWidth 设置为实际像素宽度作为基准
|
|
710
|
+
currentWidth.value = rect.width;
|
|
713
711
|
state.value = Object.freeze({
|
|
714
712
|
mouse: {
|
|
715
713
|
clientX: mouseEvent.clientX
|
|
@@ -758,12 +756,11 @@ sliderProps.width["default"] = '400';
|
|
|
758
756
|
document.addEventListener('mousemove', handleMouseMove);
|
|
759
757
|
document.addEventListener('mouseup', handleMouseUp);
|
|
760
758
|
};
|
|
761
|
-
// 监听 width prop
|
|
759
|
+
// 监听 width prop 变化,保持用户设置的原值
|
|
762
760
|
(0,external_vue_namespaceObject.watch)(function () {
|
|
763
761
|
return props.width;
|
|
764
762
|
}, function (newWidth) {
|
|
765
|
-
|
|
766
|
-
currentWidth.value = width;
|
|
763
|
+
currentWidth.value = newWidth;
|
|
767
764
|
});
|
|
768
765
|
return function () {
|
|
769
766
|
var modelSlot = {
|