js引入Tabulator.min.js和Tabulator.min.css后生成表格,点击时间排序时报luxon is not defined错误,代码如下:
<link href="./tabulator.min.css" >
<script type="text/javascript" src="./tabulator.min.js"></script>
<body>
<div id="tabulator"></div>
</body>
<script type="text/javascript">
let tabledata=[
{id:1865,title:'西瓜',sku:"023",price:20,team:['水果','夏季水果','推荐'],created:'2023-06-24 12:30:06'},
{id:1895,title:'葡萄',sku:"016",price:18,team:['水果','夏季水果','推荐'],created:'2023-06-21 12:30:06'},
{id:1765,title:'水蜜桃',sku:"017",price:24,team:['水果','夏季水果'],created:'2023-06-06 12:30:06'},
{id:1866,title:'油桃',sku:"014",price:14,team:['水果','夏季水果','推荐'],created:'2023-06-07 12:30:06'},
{id:1867,title:'水晶桃',sku:"013",price:14,team:['水果'],created:'2023-06-07 12:31:06'},
{id:1868,title:'桂味-荔枝',sku:"020",price:8,team:["未分组"],created:'2023-06-26 12:30:06'},
{id:1869,title:'龙眼',sku:"012",price:12,team:['水果','当季水果','推荐'],created:'2023-07-04 12:30:06'},
{id:1870,title:'黄皮',sku:"021",price:6,team:['水果','夏季水果','推荐'],created:'2023-06-24 12:30:06'},
{id:1871,title:'火龙果',sku:"022",price:20,team:["未分组"],created:'2023-06-24 12:30:06'}
]
let options = {
locale: "default",
height: 'auto',
layout: "fitColumns",
pagination: "true",
paginationSizeSelector: [5, 10, 15, 20],
paginationSize: 10,
paginationCounter:function(pageSize, currentRow, currentPage, totalRows, totalPages){
return "共 " + totalRows + " 条数据 ";
},
data:tabledata,
langs: {
"default": {
"pagination": {
"first": "首页",
"first_title": "首页",
"last": "末页",
"last_title": "末页",
"prev": "上一页",
"prev_title": "上一页",
"next": "下一页>",
"next_title": "下一页>",
"all": "所有",
"page_size": "",
},
},
},
columns: [
{
title: "ID",
field: "id",
sorter: "string",
headerSort:false,
hozAlign: "center",
width: 50,
},
{
title: "产品",
field: "title",
sorter: "string",
hozAlign: "center",
width: 150,
headerFilter: "input"
},
{
title: "SKU",
field: "sku",
headerSort:false,
sorter: "string",
hozAlign: "center",
width: 150,
},
{
title: "价格",
field: "price",
sorter: "number",
hozAlign: "center",
width: 180,
sorter:"number",
headerFilter:this.minMaxFilterEditor,
headerFilterFunc:this.minMaxFilterFunction,
headerFilterLiveFilter:false
// formatter: "progress",
},
{
title:"分类",
field:"team",
hozAlign: "center",
headerSort:false,
headerFilter:"list",
headerFilterParams:{valuesLookup:true, clearable:true}
},
{
title: "创建日期",
field: "created",
sorter: "datetime",
sorterParams:{
format:"yyyy-MM-dd HH:mm:ss",
alignEmptyValues:"top",
},
hozAlign: "center",
headerFilter: "input"
},
],
}
let table = new Tabulator("#tabulator",options)
</script>
是缺少了什么吗,希望帮忙解答一下