Skip to content

步进器 xStepper


在线预览
在线模拟尺寸:

介绍

可整数,小数

平台兼容

H5andriodIOS小程序UTSUNIAPP-X SDKversion
☑️☑️☑️☑️4.44+1.1.9

文件路径

ts

@/uni_modules/tmx-ui/components/x-stepper/x-stepper.uvue

使用

ts

<x-stepper></x-stepper>

Props 属性

名称说明类型默认值
modelValue当前值,可v-modelnumber0
max最大值number100
width组件宽string"auto"
min最小值number0
autoHideBtn开启后自动隐藏限制的按钮<br>最小时隐藏减号按钮booleanfalse
disabled是否禁用整个组件booleanfalse
disabledInput是否禁用输入框booleanfalse
step步进值number1
decimalLen如果进步值是小数位需要设置此值number0
btnColor按钮的颜色string"info"
darkBtnColor按钮的暗黑颜色<br>空值读取全局的Input暗黑背景色string""
bgColor输入框的背景色string"info"
inputStyle输入框的自定样式<br>可以写背景字体等样式string''
darkBgColor输入框的暗黑背景色<br>空值读取全局的Input暗黑背景色string""
btnWidth按钮的宽string"36"
height输入框及按钮的高string"36"
round按钮的圆角。string"4"
splitBtn是否按钮与输入框独立开来<br>不和输入框粘一起。booleanfalse
btnFontColor按钮文本颜色,暗黑时取白色string"#333333"
fontColor文本颜色,暗黑时取白色string"#333333"
fontSize文本文字大小string"14"

Events 事件

名称参数说明
change**** : number输入值或者点击按钮时触发
update:modelValue-等同v-model

Slots 插槽

名称说明数据

Ref 方法

名称参数返回值说明

示例文件路径

json

/pages/biaodan/stepper

示例源码

uvue
vue
<template>
	<!-- #ifdef APP -->
	<scroll-view style="flex:1">
	<!-- #endif -->
	<!-- #ifdef MP-WEIXIN -->
	<page-meta :page-style="`background-color:${xThemeConfigBgColor}`">
		<navigation-bar :background-color="xThemeConfigNavBgColor" :front-color="xThemeConfigNavFontColor"></navigation-bar>
	</page-meta>
	<!-- #endif -->
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b mb-8">步进器 Stepper</x-text>
			<x-text color="#999999" >可整数,小数步进</x-text>
		</x-sheet>
		
		<x-sheet class="flex flex-row">
			<x-stepper width="110" ></x-stepper>
		</x-sheet>
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b">达到界定值时自动隐藏按钮</x-text>
		</x-sheet>
		<x-sheet class="">
			<x-stepper :autoHideBtn="true" :max="5" width="110" ></x-stepper>
			<view class="py-10"></view>
			<x-stepper :autoHideBtn="true"  darkBtnColor="primary" btn-color="primary" btn-font-color="white" font-color="primary" :splitBtn="true" :model-value="0" width="110" ></x-stepper>
		</x-sheet>
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b">小数点</x-text>
		</x-sheet>
		<x-sheet class="flex flex-row">
			<x-stepper :decimal-len="1" :step="0.1" width="110" ></x-stepper>
		</x-sheet>
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b">圆角类型</x-text>
		</x-sheet>
		<x-sheet class="flex flex-row">
			<x-stepper :splitBtn="true" :model-value="50" width="110" ></x-stepper>
		</x-sheet>
		<x-sheet>
			<x-text font-size="18" class=" text-weight-b">更换颜色</x-text>
		</x-sheet>
		<x-sheet class="">
			<x-stepper darkBtnColor="primary" btn-color="primary" btn-font-color="white" font-color="primary" :splitBtn="true" :model-value="10" width="110" ></x-stepper>
		</x-sheet>
		
		
		
	<!-- #ifdef APP -->
	</scroll-view>
	<!-- #endif -->
</template>

<script>
	export default {
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">

</style>
最近更新