<template>

    <uni-data-picker :localdata="treeList" v-model="labels" :map="{text:'name', value: 'name'}" popup-title="请选择区域" @change="onchange"></uni-data-picker>

</template>

<script>
  import areaService from "@/api/sys/areaService"
  export default {
    props: {
	  value: String
	},
    data() {
      return {
		  labels: '',
		  treeList: []
      }
    },
	mounted() {
		areaService.treeData().then((data)=>{
			this.treeList = data
			this.labels = this.value
		}).catch((e)=>{
			 throw e
		})
	},
    methods: {
      onchange(e) {
		this.$emit('input', this.labels)
      }
    }
  }
  </script>