test slider

This commit is contained in:
2023-05-18 17:07:28 +08:00
parent 220c4f1709
commit 6c966e8424
8 changed files with 197 additions and 172 deletions

View File

@@ -32,8 +32,7 @@ function makeDots(props) {
return dots;
}
const _hoisted_1$4 = ["onMousedown"];
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-line-v" }, null, -1);
const _hoisted_3$4 = ["onClick"];
const _hoisted_2$4 = ["onClick"];
const __default__$4 = {
name: "StandardVue"
};
@@ -45,7 +44,8 @@ const _sfc_main$4 = defineComponent({
step: { default: 0 },
min: { default: 0 },
max: { default: 100 },
showDots: { type: Boolean, default: false }
showDots: { type: Boolean, default: false },
backgroundColor: { default: "#ccc" }
},
emits: ["link-val-hook"],
setup(__props, { emit }) {
@@ -129,14 +129,19 @@ const _sfc_main$4 = defineComponent({
style: normalizeStyle({ width: __props.val + "%" }),
class: normalizeClass(["layui-slider-rate-v", [__props.disabled ? "layui-slider-disabled disable-line" : ""]])
}, null, 6),
_hoisted_2$4,
createElementVNode("div", {
class: "layui-slider-line-v",
style: normalizeStyle({
backgroundColor: props.backgroundColor
})
}, null, 4),
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
return withDirectives((openBlock(), createElementBlock("div", {
onClick: ($event) => focusDot(item),
class: "layui-slider-dots",
key: index2,
style: normalizeStyle({ left: item + "%" })
}, null, 12, _hoisted_3$4)), [
}, null, 12, _hoisted_2$4)), [
[vShow, __props.showDots]
]);
}), 128))
@@ -628,7 +633,8 @@ const _sfc_main = defineComponent({
disabled: { type: Boolean, default: false },
range: { type: Boolean },
rangeValue: null,
showDots: { type: Boolean, default: false }
showDots: { type: Boolean, default: false },
backgroundColor: { default: "#ccc" }
},
emits: ["update:modelValue"],
setup(__props, { emit }) {
@@ -680,8 +686,9 @@ const _sfc_main = defineComponent({
step: __props.step,
min: __props.min,
max: __props.max,
showDots: __props.showDots
}, null, 8, ["val", "disabled", "step", "min", "max", "showDots"])
showDots: __props.showDots,
backgroundColor: props.backgroundColor
}, null, 8, ["val", "disabled", "step", "min", "max", "showDots", "backgroundColor"])
]))
]))
]);