|
|
|
@ -1,11 +1,11 @@ |
|
|
|
<template> |
|
|
|
<view class="uni-numbox"> |
|
|
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> |
|
|
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" style="background: #f5f5f5;"> |
|
|
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text> |
|
|
|
</view> |
|
|
|
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number" |
|
|
|
v-model="inputValue" :style="{background, color}" /> |
|
|
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> |
|
|
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" style="background: #f5f5f5;"> |
|
|
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -53,7 +53,7 @@ |
|
|
|
}, |
|
|
|
background: { |
|
|
|
type: String, |
|
|
|
default: '#f5f5f5' |
|
|
|
default: '#fff' |
|
|
|
}, |
|
|
|
color: { |
|
|
|
type: String, |
|
|
|
@ -155,12 +155,13 @@ |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" > |
|
|
|
$box-height: 26px; |
|
|
|
$bg: #f5f5f5; |
|
|
|
$box-height: 60rpx; |
|
|
|
$bg: #fff; |
|
|
|
$br: 2px; |
|
|
|
$color: #333; |
|
|
|
|
|
|
|
.uni-numbox { |
|
|
|
.uni-numbox { |
|
|
|
height: 60rpx; |
|
|
|
/* #ifndef APP-NVUE */ |
|
|
|
display: flex; |
|
|
|
/* #endif */ |
|
|
|
@ -187,7 +188,7 @@ |
|
|
|
width: 40px; |
|
|
|
height: $box-height; |
|
|
|
text-align: center; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 20px; |
|
|
|
border-left-width: 0; |
|
|
|
border-right-width: 0; |
|
|
|
color: $color; |
|
|
|
@ -207,7 +208,7 @@ |
|
|
|
// fix nvue |
|
|
|
line-height: 20px; |
|
|
|
|
|
|
|
font-size: 20px; |
|
|
|
font-size: 32px; |
|
|
|
font-weight: 300; |
|
|
|
color: $color; |
|
|
|
} |
|
|
|
|