格式化

This commit is contained in:
2023-05-29 13:24:55 +08:00
parent a6d8dfea39
commit 296e60f6c4
5 changed files with 226 additions and 91 deletions

View File

@@ -17,7 +17,7 @@ export interface StandardProps {
min?: number;
max?: number;
showDots?: boolean;
backgroundColor:string;
backgroundColor: string;
}
const props = withDefaults(defineProps<StandardProps>(), {
@@ -27,7 +27,7 @@ const props = withDefaults(defineProps<StandardProps>(), {
min: 0,
max: 100,
showDots: false,
backgroundColor:"#ccc"
backgroundColor: "#ccc",
});
const moveAction = throttle(standardMove);
@@ -119,9 +119,12 @@ const focusDot = (val: number) => {
class="layui-slider-rate-v"
:class="[disabled ? 'layui-slider-disabled disable-line' : '']"
></div>
<div class="layui-slider-line-v" :style="{
backgroundColor:props.backgroundColor
}"></div>
<div
class="layui-slider-line-v"
:style="{
backgroundColor: props.backgroundColor,
}"
></div>
<div
v-show="showDots"
@click="focusDot(item)"

View File

@@ -22,7 +22,7 @@ export interface SliderProps {
range?: boolean;
rangeValue?: number[];
showDots?: boolean;
backgroundColor:string;
backgroundColor: string;
}
const emit = defineEmits(["update:modelValue"]);
@@ -35,7 +35,7 @@ const props = withDefaults(defineProps<SliderProps>(), {
min: 0,
max: 100,
showDots: false,
backgroundColor:"#ccc"
backgroundColor: "#ccc",
});
let rangeValues: Ref<number[]> | any = toRef(props, "rangeValue");