How to set the default ascending order for table sorting in element-ui

clipboard.png
now it is this effect that only when you click on ascending or descending order will the application time be sorted in ascending or descending order
now if I want to enter the page, I will arrange the application time in ascending order by default
what should I do? Consult
< el-table-column prop= "applyDate" label= Application date "width=" 90 "sortable >

        <template slot-scope="scope">
           {{ formatDate(scope.row.applyDate) }}
        </template>
    </el-table-column>
  
May.07,2021

http://element-cn.eleme.io/-sharp/.
api document has
default-sort:

however, there are two cases. If it is a background page, he should only sort the current page. If it is a front-end page, he can probably sort all the data

.

then let the values returned to you by the backend be in ascending order by default

or after you receive the data yourself, make it in ascending order and render it to the table

Menu