Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table 排序问题 #158

Open
daodaolee opened this issue Jun 12, 2019 · 1 comment
Open

table 排序问题 #158

daodaolee opened this issue Jun 12, 2019 · 1 comment

Comments

@daodaolee
Copy link

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
Copy link
Contributor

yoyo837 commented Jun 12, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants