<template>
  <div class="table" style="width: 100%">
    <vue-table-dynamic :params="params"
                       @select="onSelect" ></vue-table-dynamic>
  </div>
</template>

<script>
import VueTableDynamic from 'vue-table-dynamic'

function sleep (time) {
         return new Promise((resolve) => setTimeout(resolve, time));
    }

export default {
  name: 'ip-table',
  props: ['table_data'],
  data() {
    return {
      params: {
        data: [],
        header: 'row',
        showCheck: true,
      }
    }
  },
  mounted: function () {
    // `this` points to the vm instance
    console.log('created TABLE');
  },
   methods: {
    onSelect (isChecked, index, data) {
      console.log('onSelect: ', isChecked, index, data);
      console.log('Selected:',data[1]);
      Cookies.set('computer',data[1]);
      console.log('Checked Data:', this.$refs.table.getCheckedRowDatas(true))
     },
   },
  components: { VueTableDynamic }
}

</script>