1

this is my first question in stakeoverflow. i'm new user in vuejs and vue-table-2. from the column i have no problem but i want to fill the rows with my data from my table in database. two days i just search in google to solve this problem. any one one can solve this problem?

<template>
  <div class="row">
    <div class="col-lg-12 mb-3">
      <b-card header="Data Paket" header-tag="h4" class="bg-success-card">
        <datatable title :rows="rowdata" :columns="columndata"></datatable>
      </b-card>
    </div>
  </div>
</template>
<script>
import Vue from "vue";
import axios from "axios";
import { ClientTable, Event } from "vue-tables-2";
import datatable from "components/plugins/DataTable/DataTable.vue";
Vue.use(ClientTable, {}, false);

export default {
  components: {
    datatable
  },
  data() {
    return {
      rowdata: [],

      columndata: [
        // Array of objects
        {
          label: "Name", // Column name
          field: "fname", // Field name from row
          numeric: false, // Affects sorting
          width: "200px", //width of the column
          html: false // Escapes output if false.
        },
        {
          label: "Last Name",
          field: "lname",
          numeric: false,
          html: false
        },
        {
          label: "age",
          field: "age",
          numeric: true,
          html: false
        },
        {
          label: "state",
          field: "state",
          numeric: false,
          html: false
        },
        {
          label: "Action",
          field: "button",
          numeric: false,
          html: true
        }
      ]
    };
  },

};
</script>
ePank Bae
  • 11
  • 1

0 Answers0