@atooyu/uxto-ui 1.1.17 → 1.1.19

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.js CHANGED
@@ -846,24 +846,25 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
846
846
  const props = __props;
847
847
  const emit = __emit;
848
848
  const nodeSize = vue.computed(() => Math.round(props.size * 0.8));
849
+ const switchWidth = vue.computed(() => Math.round(props.size * 1.67));
849
850
  const switchStyle = vue.computed(() => ({
850
- width: `${Math.round(props.size * 1.67)}px`,
851
+ width: `${switchWidth.value}px`,
851
852
  height: `${props.size}px`,
852
853
  borderRadius: `${props.size / 2}px`
853
854
  }));
854
855
  const nodeStyle = vue.computed(() => {
855
856
  const node = nodeSize.value;
856
857
  const gap = Math.round((props.size - node) / 2);
857
- const translateX = props.modelValue ? props.size - node - gap * 2 : 0;
858
+ const left = props.modelValue ? switchWidth.value - node - gap : gap;
858
859
  return {
859
860
  width: `${node}px`,
860
861
  height: `${node}px`,
861
862
  top: `${gap}px`,
862
- left: `${gap}px`,
863
- transform: `translateX(${translateX}px)`
863
+ left: `${left}px`
864
864
  };
865
865
  });
866
- const handleClick = () => {
866
+ const handleClick = (e) => {
867
+ e.stopPropagation();
867
868
  if (props.disabled || props.loading) return;
868
869
  const newValue = !props.modelValue;
869
870
  emit("update:modelValue", newValue);
@@ -890,7 +891,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
890
891
  };
891
892
  }
892
893
  });
893
- const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-c9caea3a"]]);
894
+ const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-8922fa66"]]);
894
895
  const _hoisted_1$y = ["src", "mode", "lazy-load", "fade"];
895
896
  const _hoisted_2$p = {
896
897
  key: 0,