From 12e60b39fb28d23d3f7ab37daeffe76fca3ff015 Mon Sep 17 00:00:00 2001
From: ajaxzheng <894103554@qq.com>
Date: Mon, 30 Oct 2023 04:53:55 -0700
Subject: [PATCH] fix(docs): [grid] update big data docs (#703)
---
.../full-data-loading-composition-api.vue | 0
.../full-data-loading.spec.js | 2 +-
.../full-data-loading.vue | 0
.../grid-large-tree-data-composition-api.vue | 0
.../grid-large-tree-data.spec.js | 2 +-
.../grid-large-tree-data.vue | 0
.../scroll-paging-composition-api.vue | 0
.../scroll-paging.spec.js | 2 +-
.../scroll-paging.vue | 0
.../virtual-rolling-composition-api.vue | 37 +++++---
.../virtual-rolling.spec.js | 2 +-
.../virtual-rolling.vue | 32 ++++---
.../grid-optimization-composition-api.vue | 79 ----------------
.../tiny-first-menu/grid-optimization.vue | 89 -------------------
.../grid/webdoc/grid-grid-optimization.cn.md | 7 --
.../grid/webdoc/grid-grid-optimization.en.md | 7 --
.../app/grid/webdoc/grid-grid-optimization.js | 18 ----
.../webdoc/grid-grid-optimization.json.cn.md | 7 --
.../webdoc/grid-grid-optimization.json.en.md | 7 --
.../pc/app/grid/webdoc/grid-large-data.js | 16 ++--
.../sites/demos/pc/app/grid/webdoc/grid.js | 8 +-
examples/sites/demos/pc/menus.js | 1 -
packages/vue/src/grid/__tests__/grid.test.tsx | 5 +-
23 files changed, 62 insertions(+), 259 deletions(-)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/full-data-loading-composition-api.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/full-data-loading.spec.js (89%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/full-data-loading.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/grid-large-tree-data-composition-api.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/grid-large-tree-data.spec.js (87%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/grid-large-tree-data.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/scroll-paging-composition-api.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/scroll-paging.spec.js (86%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/scroll-paging.vue (100%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/virtual-rolling-composition-api.vue (55%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/virtual-rolling.spec.js (88%)
rename examples/sites/demos/pc/app/grid/{tiny-first-menu => large-data}/virtual-rolling.vue (56%)
delete mode 100644 examples/sites/demos/pc/app/grid/tiny-first-menu/grid-optimization-composition-api.vue
delete mode 100644 examples/sites/demos/pc/app/grid/tiny-first-menu/grid-optimization.vue
delete mode 100644 examples/sites/demos/pc/app/grid/webdoc/grid-grid-optimization.cn.md
delete mode 100644 examples/sites/demos/pc/app/grid/webdoc/grid-grid-optimization.en.md
delete mode 100644 examples/sites/demos/pc/app/grid/webdoc/grid-grid-optimization.js
delete mode 100644 examples/sites/demos/pc/app/grid/webdoc/grid-grid-optimization.json.cn.md
delete mode 100644 examples/sites/demos/pc/app/grid/webdoc/grid-grid-optimization.json.en.md
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading-composition-api.vue b/examples/sites/demos/pc/app/grid/large-data/full-data-loading-composition-api.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading-composition-api.vue
rename to examples/sites/demos/pc/app/grid/large-data/full-data-loading-composition-api.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading.spec.js b/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js
similarity index 89%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading.spec.js
rename to examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js
index 4f5d3de27..569b452af 100644
--- a/examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading.spec.js
+++ b/examples/sites/demos/pc/app/grid/large-data/full-data-loading.spec.js
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test'
test('全量加载', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('grid-large-data#tiny-first-menu-full-data-loading')
+ await page.goto('grid-large-data#large-data-full-data-loading')
await page.locator('.tiny-grid__body').hover()
// 先滚动1000px
await page.mouse.wheel(0, 1000)
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading.vue b/examples/sites/demos/pc/app/grid/large-data/full-data-loading.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/full-data-loading.vue
rename to examples/sites/demos/pc/app/grid/large-data/full-data-loading.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data-composition-api.vue b/examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data-composition-api.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data-composition-api.vue
rename to examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data-composition-api.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data.spec.js b/examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data.spec.js
similarity index 87%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data.spec.js
rename to examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data.spec.js
index da61bd265..0a1d8457f 100644
--- a/examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data.spec.js
+++ b/examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data.spec.js
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test'
test('树表虚拟滚动', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('grid-large-data#tiny-first-menu-grid-large-tree-data')
+ await page.goto('grid-large-data#large-data-grid-large-tree-data')
// 展开树表
await page.getByRole('cell', { name: 'IR-1-120个子US' }).locator('path').click()
await expect(page.getByText('124', { exact: true })).toBeVisible()
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data.vue b/examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/grid-large-tree-data.vue
rename to examples/sites/demos/pc/app/grid/large-data/grid-large-tree-data.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging-composition-api.vue b/examples/sites/demos/pc/app/grid/large-data/scroll-paging-composition-api.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging-composition-api.vue
rename to examples/sites/demos/pc/app/grid/large-data/scroll-paging-composition-api.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging.spec.js b/examples/sites/demos/pc/app/grid/large-data/scroll-paging.spec.js
similarity index 86%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging.spec.js
rename to examples/sites/demos/pc/app/grid/large-data/scroll-paging.spec.js
index 18bf1d0c5..7bc05d7eb 100644
--- a/examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging.spec.js
+++ b/examples/sites/demos/pc/app/grid/large-data/scroll-paging.spec.js
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test'
test('滚动分页', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('grid-large-data#tiny-first-menu-scroll-paging')
+ await page.goto('grid-large-data#large-data-scroll-paging')
const scrollContainer = page.locator('.tiny-grid-body__y-space.visual')
const scrollBar = page.locator('.tiny-grid-body__y-scrollbar')
await expect(scrollContainer).toHaveCSS('height', '420px')
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging.vue b/examples/sites/demos/pc/app/grid/large-data/scroll-paging.vue
similarity index 100%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/scroll-paging.vue
rename to examples/sites/demos/pc/app/grid/large-data/scroll-paging.vue
diff --git a/examples/sites/demos/pc/app/grid/tiny-first-menu/virtual-rolling-composition-api.vue b/examples/sites/demos/pc/app/grid/large-data/virtual-rolling-composition-api.vue
similarity index 55%
rename from examples/sites/demos/pc/app/grid/tiny-first-menu/virtual-rolling-composition-api.vue
rename to examples/sites/demos/pc/app/grid/large-data/virtual-rolling-composition-api.vue
index e34972a7f..67401217f 100644
--- a/examples/sites/demos/pc/app/grid/tiny-first-menu/virtual-rolling-composition-api.vue
+++ b/examples/sites/demos/pc/app/grid/large-data/virtual-rolling-composition-api.vue
@@ -1,14 +1,5 @@
- optimization(object) 配置说明 | animat(boolean) | 表格动画效果开关(关闭后视觉效果更快)默认为 true |\n| delayHover(number) | 当表格发生拖动、滚动...等行为时,至少多少毫秒之后才允许触发 hover 事件 默认 250ms |\n| scrollX(object) | 横向 X 虚拟滚动配置(用于特殊场景手动调优)例如:{ gt: 100 } |\n| scrollY(object) | 纵向 Y 虚拟滚动配置(用于特殊场景手动调优)例如:{ gt: 500 } | optimization(object) Configuration Description | animat(boolean) | Table animation effect switch. The default value is true. |\n| delayHover(number) | When the table is dragged or scrolled, Minimum milliseconds after which the hover event can be triggered. The default value is 250 ms. |\n| scrollX(object) | Horizontal X virtual scrolling configuration (for manual optimization in special scenarios). Example: {gt: 100} |\n| scrollY(object) | Vertical Y virtual scrolling configuration (for manual optimization in special scenarios) Example: {gt: 500} | Scrolling pagination configuration procedure:\n1. Set the table attribute Virtual scrolling configuration procedure:\n1. Set optimization(object) configuration description: | delayHover(number) | (ms) after which the hover event can be triggered when a table is dragged or scrolled. The default value is 250 ms. |\n| scrollX(object) | Horizontal X virtual scrolling configuration (for manual optimization in special scenarios) Example: {gt: 100} |\n| scrollY(object) | Vertical Y Virtual Scrolling Configuration (for manual optimization in special scenarios) For example, {gt: 500} | Precautions for enabling virtual scrolling 1. Before enabling virtual scrolling, ensure that the width of each column is the same. You can configure the uniform width by setting the fetch-data
to enable the service request. \n2. Set scroll-load
to enable scrolling. height
to a fixed height for table attributes. \n2. Set optimization
to enable virtual scrolling. column-width
attribute on the <tiny-grid>
tag. \n2. Enabling virtual scrolling will disable the column width adjustment function. Column dragging will change the column width. As a result, the number of columns in virtual scrolling rendering is incorrectly calculated and the table style is disordered. Therefore, column dragging is prohibited. Name Type Description Default Value optimization.scrollX.gt number Specifies the number of columns to be automatically started when the number of columns is greater than X Virtual scrolling 100 optimization.scrollX.rSize number number of columns to be rendered each time optimization.scrollX.vSize number number of columns in the visible area optimization.scrollX.adaptive boolean Automatically adapts to the optimal rendering mode (If this parameter is set to false, the column array is intercepted only once after the scrolling is complete, which improves the performance in big data scenarios. However, the white screen will be displayed for a short time and will be restored after the rendering is complete.) true optimization.scrollY.gt number specifies the number of lines. Y: The virtual scrolling function is automatically enabled. 500 optimization.scrollY.rSize number : number of lines to be rendered each time. optimization.scrollY.adaptive boolean : automatically adapts to the optimal rendering mode. (If this parameter is set to false, the row array is captured only once after the scrolling is complete, which improves the performance in big data scenarios. However, white screen will be displayed for a short time and will be restored after the rendering is complete.) true
Performance problems may occur when there is too much data in a table. You can use $refs
to obtain table objects and set the loadData
method of the table objects to enable full loading to optimize performance.