点击拦击父事件
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="uni-numbox">
|
<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 }"
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
|
||||||
:style="{color}">-</text>
|
:style="{color}">-</text>
|
||||||
</view>
|
</view>
|
||||||
<input v-if="!showTextView" :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value"
|
<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 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 }"
|
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
|
||||||
:style="{color}">+</text>
|
:style="{color}">+</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -158,7 +158,8 @@
|
|||||||
},
|
},
|
||||||
_onFocus(event) {
|
_onFocus(event) {
|
||||||
this.$emit('focus', event)
|
this.$emit('focus', event)
|
||||||
}
|
},
|
||||||
|
mumberNone() {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user