我正在为我的表使用vue-good-table。我试着用firstSortType和initialSortBy对数据进行降序排序,根本不是对表进行排序。它总是以升序对表进行排序。我的桌子看起来像这样

我试过这样的firstSortType
{
label: "Tracking Number",
field: "docket_no",
sortable: true,
firstSortType: "desc"
},initialSortBy
<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发布于 2020-07-17 01:29:21
经过大量的研究,我能够通过添加一个v-if来解决这个问题,
<vue-good-table
v-if="rows && rows.length"
:rows="rows"
...https://stackoverflow.com/questions/62930893
复制相似问题