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

124 lines
2.3 KiB
Markdown
Raw Normal View History

2022-01-09 17:17:03 +00:00
::: anchor
:::
2022-02-05 21:20:07 +00:00
::: title 基本介绍
:::
::: describe 作为一个拖拽式的交互性组件,滑块往往能给产品带来更好的操作体验。
:::
2021-12-26 13:40:02 +00:00
::: title 横向
:::
2022-02-01 19:27:34 +00:00
::: demo 使用 `lay-slider` 标签, 创建滑块
<template>
2022-03-08 23:28:54 +00:00
<lay-slider :max="88" v-model="value1" :disabled="false"></lay-slider>
2022-02-05 03:24:03 +00:00
<lay-input-number v-model="value1"></lay-input-number>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-17 12:52:45 +00:00
const value1 = ref(50)
return {
2021-12-17 12:52:45 +00:00
value1
}
}
}
</script>
:::
2021-12-26 13:40:02 +00:00
::: title 纵向
:::
::: demo
<template>
2022-02-05 03:24:03 +00:00
<lay-slider v-model="value2" :vertical="true" :disabled="false"></lay-slider>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-17 12:52:45 +00:00
const value2 = ref(10)
return {
2021-12-17 12:52:45 +00:00
value2
}
}
}
</script>
2021-12-16 09:57:59 +00:00
:::
2021-12-26 13:40:02 +00:00
::: title 区间
:::
2021-12-26 03:13:15 +00:00
::: demo
2021-12-26 13:40:02 +00:00
<template>
2022-03-08 23:28:54 +00:00
<lay-slider :disabled="false" :min="10" :max="80" v-model:rangeValue="value3" :range="true"></lay-slider>
2021-12-26 03:13:15 +00:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2021-12-26 13:40:02 +00:00
const value3 = ref([20,50])
2021-12-26 03:13:15 +00:00
return {
2021-12-26 13:40:02 +00:00
value3
2021-12-26 03:13:15 +00:00
}
}
}
</script>
2021-12-26 13:40:02 +00:00
:::
2021-12-26 03:13:15 +00:00
2021-12-28 05:09:08 +00:00
::: title 纵向区间
:::
::: demo
<template>
2022-03-08 23:28:54 +00:00
<lay-slider v-model:rangeValue="value4" :range="true" :vertical="true" :disabled="false"></lay-slider>
2021-12-28 05:09:08 +00:00
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
2022-01-05 04:42:50 +00:00
const value4 = ref([23,56])
2021-12-28 05:09:08 +00:00
return {
value4
}
}
}
</script>
:::
2022-01-09 17:17:03 +00:00
::: title Slider 属性
2022-01-05 04:51:32 +00:00
:::
::: table
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
| ------------ | --------------------- | ------------------------- | -------------- | -------- |
2022-02-05 03:34:04 +00:00
| v-model | 选中值 | `Number` | - | - |
2022-01-05 04:51:32 +00:00
| vertical | 是否垂直 | `Boolean` | - | - |
| range | 是否区间 | `Boolean` | - | - |
2022-03-08 23:28:54 +00:00
| rangeValue | 区间值 | `Array` | - | - |
2022-02-05 03:34:04 +00:00
| step | 步长 | `Number` | - | - |
2022-03-08 23:28:54 +00:00
| min | 最小值 | `Number` | - | - |
| max | 最大值 | `Number` | - | - |
2022-01-05 04:51:32 +00:00
:::
2022-03-29 23:44:37 +00:00
2022-01-12 06:19:06 +00:00
::: previousNext slider
:::