更新记录
1.0.0(2023-05-19)
下载此版本
首次发布
平台兼容性
uni-app
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
| √ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
mos-popup-ruler
属性:
| 属性 |
说明 |
类型 |
默认值 |
| title |
标题 |
String |
- |
| unit |
单位 |
String |
厘米 |
| themeColor |
主题颜色 |
String |
#0CC782 |
| value |
绑定数值 |
Number |
- |
| defaultValue |
默认数值 |
Number |
- |
| min |
最小值 |
Number |
100 |
| max |
最大值 |
Number |
230 |
| point |
是否小数(该属性为true时保留一位小数) |
Boolean |
false |
事件:
| 事件 |
说明 |
返回值 |
示列 |
| @onConfirm |
确认按钮返回值 |
Number |
150 |
方法:
| 方法 |
说明 |
返回值 |
示列 |
| show |
打开 |
- |
- |
| hide |
关闭 |
- |
- |
实例:
<template>
<view class="content">
<button @click="openMosPopupRuler(1)">打开整数选择</button>
<button @click="openMosPopupRuler(2)">打开小数选择</button>
<mos-popup-ruler title="整数" unit="厘米" :max='235' @onConfirm="onHeightConfirm" :value="form.height" ref="pickerHeightRef"></mos-popup-ruler>
<mos-popup-ruler title="小数" unit="厘米" :min="0" :max="10" point @onConfirm="onWeightConfirm" :value="form.weight" ref="pickerWeightRef"></mos-popup-ruler>
</view>
</template>
<script>
export default {
data() {
return {
form:{
height:'',
weight:''
}
}
},
onLoad() {
},
methods: {
openMosPopupRuler(n){
let ref = this.$refs[n==1?'pickerHeightRef':'pickerWeightRef']
if(ref){
ref.show()
}
},
onHeightConfirm(h){
console.log(h)
},
onWeightConfirm(w){
console.log(w)
}
}
}
</script>