Skip to content

Commit

Permalink
Merge pull request #2060 from VisActor/docs/sortDemo
Browse files Browse the repository at this point in the history
docs: fix list_sort demo
  • Loading branch information
fangsmile committed Jul 9, 2024
2 parents 3ccfc47 + c8e1748 commit 58f5d99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/assets/guide/en/basic_function/sort/list_sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,9 @@ const option = {
// 创建 VTable 实例
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window.tableInstance = tableInstance;
const clickCount = 0;
let clickCount = 0;
tableInstance.on('sort_click', args => {
clickCount++;
const sortState = clickCount % 3 === 0 ? 'desc' : clickCount % 3 === 1 ? 'asc' : 'normal';
sortRecords(args.field, sortState)
.then(records => {
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/guide/zh/basic_function/sort/list_sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,9 @@ const option = {
// 创建 VTable 实例
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window.tableInstance = tableInstance;
const clickCount = 0;
let clickCount = 0;
tableInstance.on('sort_click', args => {
clickCount++;
const sortState = clickCount % 3 === 0 ? 'desc' : clickCount % 3 === 1 ? 'asc' : 'normal';
sortRecords(args.field, sortState)
.then(records => {
Expand Down

0 comments on commit 58f5d99

Please sign in to comment.