vux
  • 关于Vux
  • 开始使用之前
  • 常见问题
  • 兼容
  • 组件规范
  • PR规范
  • playground
  • 版本变更
  • 谁在使用
  • 最佳实践
  • 安装
    • vue-cli项目引用.vue组件(推荐)
    • vue-cli项目引用umd组件
    • 使用script全局引入
  • 布局组件
    • Flexbox
    • Scroller
    • Tab 选项卡
    • Popup 弹出层
    • Sticky 自动固定在顶部
    • Tabbar 底部导航
    • ButtonTab
    • Timeline
    • XHeader
    • Step
  • UI组件
    • divider 横向分隔线
    • badge
    • icon
    • Search 搜索
  • 常用样式
    • 1px解决方案
    • reddot红点提示
  • 表单组件
    • Group表单分组组件
    • Cell
    • Address
    • x-button 按钮
    • x-input 单行文本输入
    • x-textarea 多行输入框
    • x-number 数字输入
    • checklist 多选
    • selector 下拉选择
    • switch 开关
    • rater 评分
    • Inline-Calendar 内联日历
    • Calendar 日历
    • Radio 单选
    • Checker 灵活的选择组件
    • Datetime 时间
    • Range
    • picker
    • popup-picker
    • 表单验证(v0.1.1)
  • 时间组件
    • 日期倒计时
    • 秒数倒计时
    • 轻量时间格式化
    • 相对时间
  • 数字组件
    • number-roller 数字滚动
  • 提示组件
    • Loading
    • Alert
    • Confirm
    • Toast
    • Actionsheet
    • Dialog
    • Spinner
  • 图片
    • 背景模糊
    • 半透明遮罩
    • 轮播
    • 表情图片
    • 上传(未支持)
    • 点击全屏预览图片(未支持)
  • 动态检测
    • 屏幕翻转
    • 手机摇一摇
  • 图表组件
    • Circle 圆圈
  • http请求
  • router 路由
  • 手势操作
Powered by GitBook
On this page
  • Props
  • Demo
  • 基本使用
  • 自定义步长
  • 设置bar的高度和手柄的位置
  • 双向绑定
  1. 表单组件

Range

Props

参数

说明

类型

默认值

decimal

可选,是否开启小数支持

Boolean

false

value

可选,当前选择值

Number

0

min

可选,取值范围最小值

Number

0

max

可选,取值范围最大值

Number

100

min-html

可选,最小值定制内容

String

无

max-html

可选,最大值定制内容

String

无

step

可选,滑动步长

Number

0

disabled

可选,是否为禁止状态

Boolean

false

disabled-opacity

可选,禁止状态下控件的透明度

Number

0.75

range-bar-height

可选,状态条的高度

Number

1

range-handle-height

可选,滑柄位置

Number

30

Demo

基本使用

``` vux width=100% height=220px components=Group,Cell,Range

</template>

export default { data () { return { value1: 0, value2: 0, value3: 20 } } }

### 设置起始值和最大值

``` vux width=100% height=210px components=Group,Cell,Range

<template>
<group>
  <cell title="min=8" :inline-desc="'value is: '+value1" primary="content">
    <range slot="value" :value.sync="value1" :min=8></range>
  </cell>
  <cell title="max=88" :inline-desc="'value is: '+value2" primary="content">
    <range slot="value" :value.sync="value2" :max=88></range>
  </cell>
  <cell title="min and max" :inline-desc="'value is: '+value3" primary="content">
    <range slot="value" :value.sync="value3" :min=7 :max=77></range>
  </cell>
</group>
</template>
<script>
export default {
  data () {
    return {
      value1: 25,
      value2: 25,
      value3: 25
    }
  }
}
</script>

自定义步长

``` vux width=100% height=100px components=Group,Cell,Range

</template>

export default { data () { return { value: 25 } } }

### 禁用组件

``` vux width=100% height=150px components=Group,Cell,Range

<template>
  <group>
    <cell title="disabled=true" :inline-desc="'valus is: '+value1" primary="content">
      <range slot="value" :value.sync="value1" disabled></range>
    </cell>
    <cell title="Opacity" :inline-desc="'valus is: '+value2" primary="content">
      <range slot="value" :value.sync="value2" disabled :disabled-opacity=0.1></range>
    </cell>
  </group>
</template>
<script>
export default {
  data () {
    return {
      value1: 25,
      value2: 25
    }
  }
}
</script>

设置bar的高度和手柄的位置

``` vux width=100% height=150px components=Group,Cell,Range

</template>

export default { data () { return { value: 25 } } }

### 自定义初始值和最大值

``` vux width=100% height=150px components=Group,Cell,Range

<template>
<group>
  <cell title="文字大小" :inline-desc="'font size: ' + value1" primary="content">
    <range slot="value" :value.sync="value1" :min="12" :max="22" min-HTML="<span style='font-size:12px;'>小</span>" max-HTML="<span style='font-size:22px;'>大</span>"></range>
  </cell>
  <cell title="bcontentness" :inline-desc="'value is: ' + value2 + '%'" primary="content">
    <range slot="value" :value.sync="value2" min-HTML="<span style='font-size:16px;color:#F90;'>☼</span>" max-HTML="<span style='font-size:30px;color:#F90;'>☼</span>"></range>
  </cell>
</group>
</template>
<script>
export default {
  data () {
    return {
      value1: 14,
      value2: 25
    }
  }
}
</script>

双向绑定

``` vux width=100% height=150px components=Group,Cell,Range

</template>

export default { data () { return { value: 0 } } } ```

PreviousDatetime 时间Nextpicker

Last updated 7 years ago