<template>
	<view>		
		<view >
			<uni-data-select
			     v-model="valuelegs"
			     :localdata="range"
			     @change="change"
			   ></uni-data-select>  
		</view>
	</view>
		
</template>

<script>
		
	export default {
		name:'selectLeg',
		data() {
			return{	
				valuelegs:'',
				leglast:'',
				//value: '',
				range: [
				        { value: 0, text: '0' },
				        { value: -1, text: '-1' },
				        { value: -2, text: '-2' },
						{ value: -3, text: '-3' },
						{ value: -4, text: '-4' },
						{ value: -5, text: '-5' },
						{ value: -6, text: '-6' },
						{ value: -7, text: '-7' },
						{ value: -8, text: '-8' },
						{ value: -9, text: '-9' },
						{ value: -10, text: '-10' },
				],
			}
		},
		props: {	
			valueleg:{
				type: Number,
			}
		},
		watch:{
			
		},
		methods:{						
			change(e) {
			    console.log("e:", e);
				let itemp = ''
				if(e=== 0 ){
					console.log('log-----',e)
					this.$emit('changevalue', e);
				}else if (e<0){
					this.$emit('changevalue', e);
				}else {
					itemp = undefined
					this.$emit('changevalue', itemp);
				}
				
			},
			getleglast(){
				return this.leglast
			}
			
		},
		created() {	
			if(this.valueleg != undefined){
				 this.valuelegs = this.valueleg
			}
			
		}
	}
</script>

<style>
</style>