<template>
  <view class="content">
	  <device-item v-for="(device,index) in deviceList" :key="index" :device="device" @onclick="goDeviceInfo(device)"></device-item>
  </view>
</template>

<script>
import deviceItem from '../../../../components/device-manager/deviceItem/deviceItem.vue';
export default {
  components: { deviceItem },
  data() {
    return {
      battery: 101,
    };
  },
  methods: {
	  goDeviceInfo(device) {
	    console.log("goDeviceInfo");
	    uni.navigateTo({
	      url: `../deviceDetail/deviceDetail?model=${device.ProdModel}&name=${device.devName}&uuid=${device.uuid}`,
	      complete(res){
	        console.warn(res);
	      }
	    });
	  },
  },
  computed:{
	  deviceList(){
		  return this.$store.state.moduleMqtt.deviceList;
	  }
  }
};
</script>

<style>
.content {
  display: flex;
  flex-direction: column;

}
</style>
