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

125 lines
2.2 KiB
Markdown
Raw Normal View History

2022-01-10 01:17:03 +08:00
::: anchor
:::
2022-02-06 05:20:07 +08:00
::: title 基本介绍
:::
::: describe 作为一个拖拽式的交互性组件,滑块往往能给产品带来更好的操作体验。
:::
2021-12-26 21:40:02 +08:00
::: title 横向
:::
2022-02-02 03:27:34 +08:00
::: demo 使用 `lay-slider` 标签, 创建滑块
<template>
2022-02-05 11:24:03 +08:00
<lay-slider v-model="value1" :disabled="false"></lay-slider>
<lay-input-number v-model="value1"></lay-input-number>
</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>
2022-02-05 11:24:03 +08:00
<lay-slider v-model="value2" :vertical="true" :disabled="false"></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-10 01:17:03 +08:00
::: title Slider 属性
2022-01-05 12:51:32 +08:00
:::
::: table
| 属性 | 描述 | 类型 | 可选值 | 默认值 |
| ------------ | --------------------- | ------------------------- | -------------- | -------- |
2022-02-05 11:34:04 +08:00
| v-model | 选中值 | `Number` | - | - |
2022-01-05 12:51:32 +08:00
| vertical | 是否垂直 | `Boolean` | - | - |
| range | 是否区间 | `Boolean` | - | - |
| verticalrange | 垂直区间值 | `Array` | - | - |
| standardrange | 水平区间值 | `Array` | - | - |
2022-02-05 11:34:04 +08:00
| step | 步长 | `Number` | - | - |
2022-01-05 12:51:32 +08:00
:::
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
:::