<template>
  <view class="meter-statistic"  >
    <tree-node  v-for="(item,i) in meterList"
	  :ref="'tree-node'+i"
	   @query="query"
	 :key="i" :node="item" ></tree-node>
  </view>
</template>
 
<script>
import TreeNode from './tree-node.vue';
 
export default {
  components: {
    TreeNode
  },
  props: {
  	meterList:{
			type: Array,
			default() {
				return [];
			}
	},
  	elderStatus: false
  },
  methods:{
	  toggle(){
		  // for(var i in this.meterList){
			 // this.$nextTick(()=>{
				//  this.$refs['tree-node'+i].toggle()
				 
			 // })
			  
		  // }
		 
		  
	  },
	  query(item){
	  		   this.$emit('query',item)
	  },
  },
  data() {
    return {
      treeData: {
        name: 'Root',
        children: [
          {
            name: 'Child 1',
            children: [
              { name: 'Grandchild 1.1' },
              { name: 'Grandchild 1.2' }
            ]
          },
          {
            name: 'Child 2',
            children: [
              { name: 'Grandchild 2.1' },
              { name: 'Grandchild 2.2' }
            ]
          }
        ]
      }
    };
  }
};
</script>