Happy-Coding-Clans / vue-easytable

A powerful data table based on vuejs. You can use it as data grid、Microsoft Excel or Google sheets. It supports virtual scroll、cell edit etc.
https://happy-coding-clans.github.io/vue-easytable/
MIT License
3.69k stars 738 forks source link

[Bug Report] nuxt第一次渲染,点排序会出现 l is not a function #381

Closed luchanan closed 3 years ago

luchanan commented 3 years ago

选择要提交 issue 的库

vue-easytable

Issue 类型

Bug

Issue 标题

nuxt第一次渲染,点排序会出现下面的错误

仓库版本

2.5.2

Vue 版本

2.6.14

浏览器

chrome

系统类型

windows

重现链接

重现步骤

nuxt第一次渲染,点排序会出现下面的错误

期望的结果是什么?

点排序不报错

实际的结果是什么?

TypeError: l is not a function
at VueComponent.sortChange (main.js?9145:1)
at VueComponent.eval (main.js?9145:1)

定位代码

sortChange({currentField: e, sortResult: t}) {
                const {sortColumns: n, sortOption: i} = this
                  , {multipleSort: o, sortChange: l} = i;
                if (this.sortColumns[e] = t,
                !o)
                    for (const t in n)
                        t !== e && (n[t] = "");
                l(n)
            },
huangshuwei commented 3 years ago

1、猜测是没有提供sortChange(param)回调函数,具体排序逻辑需要在sortChange(param)函数中实现

2、通过 sortOption对象,设置更多排序功能。排序功能需要配合sortChange(param)回调函数实现,回调参数包含列的排序规则

3、具体示例:https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/header-sort?anchor=dan-zi-duan-pai-xu