How to fix errors and warnings vite/vue.
After adding the data, I will give it axios data and then I want to create a datatable. It can be done but the error and warning like in the picture always come up.
async createDataTable() {
await this.$nextTick();
const table = await window.$("#myTableCorporation").DataTable();
if (table) {
await table.destroy();
}
await window.$("#myTableCorporation").DataTable({
oLanguage: {
sDecimal: "",
sEmptyTable: "ไม่มีรายการข้อมูล",
sInfo: "แสดงรายการที่ _START_ ถึง _END_ จาก _TOTAL_ รายการ",
sInfoEmpty: "ไม่มีรายการข้อมูล",
sInfoFiltered: "(กรองจากทั้งหมด _MAX_ รายการ)",
sInfoPostFix: "",
sThousands: ",",
sLengthMenu: "แสดง _MENU_ รายการ",
sLoadingRecords: "กำลังโหลดข้อมูล...",
sProcessing: "กำลังประมวลผล...",
sSearch: "ค้นหา:",
sZeroRecords: "ไม่พบรายการที่ค้นหา",
oPaginate: {
sFirst: "หน้าแรก",
sLast: "หน้าสุดท้าย",
sNext: "ถัดไป",
sPrevious: "ก่อนหน้า",
},
},
columnDefs: [
{ className: "dt-center", targets: "_all" },
{ className: "dt-body-left", targets: [3, 4, 6, 7] },
{ width: "10%", targets: [2, 5] },
{ width: "20%", targets: [3, 4] },
{ width: "5%", targets: [0, 1, 6, 7] },
],
scrollX: true,
autoWidth: false,
responsive: true,
});
},
},
watch: {
_getCorporation() {
this.createDataTable();
},
},