<template>
	<u-number-box v-model="number" class="fz-28">
		<view slot="minus"  class="minus" @tap="minus" >
			<u-icon  name="minus"  size="12"  ></u-icon>
		</view>
		<text slot="input"  style="width: 50px;text-align: center;" class="input" >{{amount}}</text>
		<view slot="plus" class="plus" @tap="plus" >
			<u-icon  name="plus" color="#FFFFFF"  size="12" ></u-icon>
		</view>
	</u-number-box>
</template>
<script>
	/**
	 * 购物车数量卡片
	 * @property {Number} amount - 数量
	 * @property {Object} popupShow - 商品信息
	 */
	export default {
		props:{
			amount:{
				typeof:Number,
				default:1
			}
		},
		data(){
			return { 
				num :0
			}
		},
		methods:{
			minus() {
				this.num = this.amount;
				this.num==0?0:this.num--;
				// this.$emit("changeNum",this.num);
			},
			plus(){
				this.num = this.amount;
				this.num++;
				// this.$emit("changeNum",this.num);
			}
		}
	}
</script>
<style lang="scss" scoped>
</style>