[Vuejs]-Vuejs โ€“ reading data from table

0๐Ÿ‘

I am pasting the code one more time as Iโ€™ve removed some unnecessary stuff:

<table v-if="tableData.length > 0" class="table table-bordered table-sm">
<thead>
  <tr>
    <th scope="col">#</th>
    <th scope="col">Date From</th>
    <th scope="col">Date To</th>
    <th scope="col">Days</th>
    <th scope="col">Type</th>
    <th scope="col">Request Date</th>
  </tr>
</thead>
<tbody>
  <tr v-for="(object, index) in tableData" :key="index">
    <th scope="=row"><label class="tableNumberColumn">{{index + 1}}</label></th>
    <td v-for="(value, key) in object" :key="key" v-if="key != 'formId'">
      <div class="container tableColumnDiv" v-if="key === 'numberOfDays'" contenteditable="true">{{value}}</div>
      <div class="container tableColumnDiv" v-else-if="key === 'timeOffType'" contenteditable="true">{{value}}</div>
      <div v-else>
        <datepicker :value="value" :bootstrap-styling="true"></datepicker>
      </div>
    </td>
    <td>
      <b-button @click="deleteRow(index)" class="btn btn-sm buttonDelete">Delete</b-button>
    </td>
    <td>
      <b-button @click="update(index)" class="btn btn-sm buttonUpdate">Update</b-button>
    </td>
    <td>
      <b-button class="btn btn-sm buttonPrint">Print</b-button>
    </td>
  </tr>
</tbody>

Leave a comment