Skip to content

步进器 xStepper


在线预览
在线模拟尺寸:

介绍

可整数,小数

平台兼容

HarmonyH5andriodIOS小程序UTSUNIAPP-X SDKversion
☑️☑️☑️☑️4.76+1.1.18

文件路径

ts

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

使用

ts

<x-stepper></x-stepper>

Props 属性

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

Events 事件

名称参数说明
changenumber输入值或者点击按钮时触发
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 setup lang="ts">
	
</script>

<style lang="scss">

</style>
最近更新