layui/example/docs/zh-CN/components/slider.md

114 lines
1.8 KiB
Markdown
Raw Normal View History

2021-12-26 21:40:02 +08:00
::: title 横向
:::
::: demo
<template>
2021-12-26 11:13:15 +08:00
<lay-slider v-model="value1" :disabled="false"></lay-slider>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-17 20:52:45 +08:00
const value1 = ref(50)
return {
2021-12-17 20:52:45 +08:00
value1
}
}
}
</script>
:::
2021-12-26 21:40:02 +08:00
::: title 纵向
:::
::: demo
<template>
2021-12-26 21:40:02 +08:00
<lay-slider v-model="value2" :vertical="true" :disabled="true"></lay-slider>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-17 20:52:45 +08:00
const value2 = ref(10)
return {
2021-12-17 20:52:45 +08:00
value2
}
}
}
</script>
2021-12-16 17:57:59 +08:00
:::
2021-12-26 21:40:02 +08:00
::: title 区间
:::
2021-12-26 11:13:15 +08:00
::: demo
2021-12-26 21:40:02 +08:00
<template>
2022-01-05 12:51:32 +08:00
<lay-slider v-model:standardrange="value3" :range="true"></lay-slider>
2021-12-26 11:13:15 +08:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-26 21:40:02 +08:00
const value3 = ref([20,50])
2021-12-26 11:13:15 +08:00
return {
2021-12-26 21:40:02 +08:00
value3
2021-12-26 11:13:15 +08:00
}
}
}
</script>
2021-12-26 21:40:02 +08:00
:::
2021-12-26 11:13:15 +08:00
2021-12-28 13:09:08 +08:00
::: title 纵向区间
:::
::: demo
<template>
2022-01-05 12:42:50 +08:00
<lay-slider v-model:verticalrange="value4" :range="true" :vertical="true"></lay-slider>
2021-12-28 13:09:08 +08:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2022-01-05 12:42:50 +08:00
const value4 = ref([23,56])
2021-12-28 13:09:08 +08:00
return {
value4
}
}
}
</script>
:::
2022-01-05 12:51:32 +08:00
::: title slider 属性
:::
::: table
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
| ------------ | --------------------- | ------------------------- | -------------- | -------- |
| v-model | 选中值 | `number` | - | - |
| vertical | 是否垂直 | `Boolean` | - | - |
| range | 是否区间 | `Boolean` | - | - |
| verticalrange | 垂直区间值 | `Array` | - | - |
| standardrange | 水平区间值 | `Array` | - | - |
:::
2021-12-26 21:40:02 +08:00
::: comment
2021-12-26 11:13:15 +08:00
:::
2022-01-12 14:19:06 +08:00
::: previousNext slider
:::