123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <view class="main">
- <uni-icons type="minus-filled" size="20" color="#A67A54" @click="numReduce"></uni-icons>
- <!-- <text class="buy-select">{{number}}</text> -->
- <!-- <u-input
- v-model="number"
- type="number"
- height="40"
- :placeholder="placeholder"
- :clearable="false"
- :disabled="isDisabled"
- input-align="center"
- :custom-style="{width:'45px'}"
- @input="onKeyInput"/> -->
- <!-- <input class="uni-input" v-model="number" :type="isInt?'number' : 'digit'" :disabled="isDisabled" :placeholder="placeholder" @input="onKeyInput" > -->
- <input class="uni-input" :value="number" :type="isInt?'number' : 'digit'" :disabled="isDisabled" :placeholder="placeholder" @input="onKeyInput" >
- <uni-icons type="plus-filled" size="20" color="#A67A54" @click="numPlus"></uni-icons>
- </view>
- </template>
- <script>
- export default {
- props: {
- number: {
- default: 1
- },
- isDisabled: {
- default: false
- },
- isInt: {
- default: true
- },
- placeholder: {
- default: ''
- },
- step: {
- default: 1
- },
- minNum: {
- default: 0.01
- }
- },
- data() {
- return {
- }
- },
- methods: {
- onKeyInput(event) {
- let i = event.target.value
- this.$emit('onKeyInput',i)
- },
- numPlus() {
- this.$emit('numPlus',this.number,);
- },
- numReduce() {
- this.$emit('numReduce',this.number,);
- }
- }
- }
- </script>
- <style>
- </style>
- <style lang="less" scoped>
- .main {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .uni-input {
- height: 40px;
- width: 45px;
- text-align: center;
- }
- }
- </style>
|