【发布时间】:2021-04-09 03:41:09
【问题描述】:
我创建了一个代码,它应该使用制表符显示 csv 文件的内容,我按照一些教程视频编写了代码。但仍然没有显示数据。我也没有收到任何错误。任何人都可以帮助我。
import xlsx from "xlsx";
import feather from "feather-icons";
import Tabulator from "tabulator-tables";
(function (cash) {
"use strict";
// Tabulator
if (cash("#tabulator").length) {
// Setup Tabulator
let table = new Tabulator("#tabulator", {
ajaxURL: "C:/Users/Desktop/All Desktop File/GARRS.csv",
ajaxFiltering: true,
ajaxSorting: true,
printAsHtml: true,
printStyled: true,
pagination: "remote",
paginationSize: 10,
paginationSizeSelector: [10, 20, 30, 40],
layout: "fitColumns",
responsiveLayout: "collapse",
placeholder: "No matching records found",
columns: [
{
formatter: "responsiveCollapse",
width: 40,
minWidth: 30,
align: "center",
resizable: false,
headerSort: false,
},
{
title: "PRODUCT NAME",
minWidth: 200,
responsive: 0,
field: "name",
vertAlign: "middle",
print: false,
download: false,
formatter(cell, formatterParams) {
return `<div>
<div class="font-medium whitespace-nowrap">${
cell.getData().name
}</div>
<div class="text-gray-600 text-xs whitespace-nowrap">${
cell.getData().category
}</div>
</div>`;
},
},
有没有办法做到这一点。并且我对此也没有任何错误,所以我不知道真正的问题是什么。
我是新手,请帮帮我
【问题讨论】: