AT-UI / at-ui

A fresh and flat UI-Kit specially for desktop application, made with ♥ by Vue.js 2.0 (DEPRECATED)
https://at.aotu.io
MIT License
2.34k stars 231 forks source link

table 排序问题 #158

Open daodaolee opened 5 years ago

daodaolee commented 5 years ago

table排序有时候不会按照从大到小排列,或者从小到大排,看了源码,有一段:

table.vue (line410)
sort (data,
 type, index) {
      const key = this.columnsData[index].key
      data.sort((a, b) => {
        if (this.columnsData[index].sortMethod) {
          return this.columnsData[index].sortMethod(a[key], b[key], type)
        } else if (type === 'asc') {
          return a[key] > b[key] ? 1 : -1
        }
        return a[key] < b[key] ? 1 : -1
      })
      return data
    }

有个sortMethod,也没找到他的说明,请修复

yoyo837 commented 5 years ago

你看下最后提交时间,项目死了,fork过去自己改吧