@atooyu/uxto-ui 1.1.17 → 1.1.18
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 +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +4 -4
- package/package.json +1 -1
- package/src/components/u-switch/u-switch.vue +7 -3
package/dist/index.js
CHANGED
|
@@ -846,15 +846,16 @@ 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: `${
|
|
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 ?
|
|
858
|
+
const translateX = props.modelValue ? switchWidth.value - node - gap * 2 : 0;
|
|
858
859
|
return {
|
|
859
860
|
width: `${node}px`,
|
|
860
861
|
height: `${node}px`,
|
|
@@ -863,7 +864,8 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
863
864
|
transform: `translateX(${translateX}px)`
|
|
864
865
|
};
|
|
865
866
|
});
|
|
866
|
-
const handleClick = () => {
|
|
867
|
+
const handleClick = (e) => {
|
|
868
|
+
e.stopPropagation();
|
|
867
869
|
if (props.disabled || props.loading) return;
|
|
868
870
|
const newValue = !props.modelValue;
|
|
869
871
|
emit("update:modelValue", newValue);
|
|
@@ -890,7 +892,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
|
890
892
|
};
|
|
891
893
|
}
|
|
892
894
|
});
|
|
893
|
-
const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-
|
|
895
|
+
const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-ea7de305"]]);
|
|
894
896
|
const _hoisted_1$y = ["src", "mode", "lazy-load", "fade"];
|
|
895
897
|
const _hoisted_2$p = {
|
|
896
898
|
key: 0,
|