slider 文档
This commit is contained in:
parent
ada270da87
commit
7734f0cb5b
@ -53,7 +53,7 @@ export default {
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
<lay-slider v-model="value3" :range="true"></lay-slider>
|
||||
<lay-slider v-model:standardrange="value3" :range="true"></lay-slider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -91,5 +91,20 @@ export default {
|
||||
</script>
|
||||
:::
|
||||
|
||||
::: title slider 属性
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
|
||||
| ------------ | --------------------- | ------------------------- | -------------- | -------- |
|
||||
| v-model | 选中值 | `number` | - | - |
|
||||
| vertical | 是否垂直 | `Boolean` | - | - |
|
||||
| range | 是否区间 | `Boolean` | - | - |
|
||||
| verticalrange | 垂直区间值 | `Array` | - | - |
|
||||
| standardrange | 水平区间值 | `Array` | - | - |
|
||||
|
||||
:::
|
||||
|
||||
::: comment
|
||||
:::
|
||||
|
@ -116,6 +116,7 @@ interface LaySliderProps {
|
||||
disabled?: boolean;
|
||||
range?: boolean;
|
||||
verticalrange?: number[];
|
||||
standardrange?: number[];
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<LaySliderProps>(), {
|
||||
@ -124,11 +125,12 @@ const props = withDefaults(defineProps<LaySliderProps>(), {
|
||||
disabled: false,
|
||||
});
|
||||
|
||||
let rangeValue: Ref<number[]> = ref([0, 0]);
|
||||
if (Array.isArray(props.modelValue)) {
|
||||
// eslint-disable-next-line vue/no-setup-props-destructure
|
||||
rangeValue.value = props.modelValue;
|
||||
}
|
||||
// let rangeValue: Ref<number[]> = ref([0, 0]);
|
||||
let rangeValue: Ref<number[]> | any = toRef(props, "standardrange");
|
||||
// if (Array.isArray(props.modelValue)) {
|
||||
// // eslint-disable-next-line vue/no-setup-props-destructure
|
||||
// rangeValue.value = props.modelValue;
|
||||
// }
|
||||
|
||||
let verticalRangeValue: Ref<number[]> | any = toRef(props, "verticalrange");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user