【发布时间】:2020-07-16 08:45:00
【问题描述】:
我正在为我的表使用 vue-good-table。我尝试使用firstSortType 和initialSortBy 对数据进行降序排序,它根本没有对表格进行排序。它总是按升序对表格进行排序。我的桌子看起来像这样
我试过这样firstSortType
{
label: "Tracking Number",
field: "docket_no",
sortable: true,
firstSortType: "desc"
},
初始排序方式
<vue-good-table
:columns="tableColumns1"
:rows="shipments"
:line-numbers="true"
:search-options="{
enabled: true,
placeholder: 'Type to search',
}"
:pagination-options="{
enabled: true,
mode: 'pages',
}"
:sort-options="{
enabled: true,
initialSortBy: [
{field: 'docket_no', type: 'desc'}
],
}" />
当我尝试使用 initialSortBy 时,它会显示此错误
TypeError: Cannot read property 'setInitialSort' of undefined
【问题讨论】:
标签: vue.js vue-good-table