|
|
@ -1,13 +1,13 @@ |
|
|
|
<template> |
|
|
|
<view class="uni-numbox"> |
|
|
|
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> |
|
|
|
<view @click.stop="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> |
|
|
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" |
|
|
|
:style="{color}">-</text> |
|
|
|
</view> |
|
|
|
<input v-if="!showTextView" :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" |
|
|
|
type="number" v-model="inputValue" :style="{background, color}" /> |
|
|
|
type="number" v-model="inputValue" :style="{background, color}" @click.stop="mumberNone" /> |
|
|
|
<view v-if="showTextView" class="uni-numbox__value" :style="{background, color}">{{inputValue}}</view> |
|
|
|
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> |
|
|
|
<view @click.stop="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> |
|
|
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" |
|
|
|
:style="{color}">+</text> |
|
|
|
</view> |
|
|
@ -158,7 +158,8 @@ |
|
|
|
}, |
|
|
|
_onFocus(event) { |
|
|
|
this.$emit('focus', event) |
|
|
|
} |
|
|
|
}, |
|
|
|
mumberNone() {} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|