@kevairy/template 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevairy/template",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Project template consumed by @kevairy/cli",
5
5
  "keywords": [
6
6
  "vue",
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: kevairy-ui
3
+ description: Guide Vue 3 admin UI work toward @kevairy/components and established Kevairy template patterns. Use when creating, changing, reviewing, or refactoring pages, forms, tables, search and filter flows, dialogs, statuses, cards, data display, composables, or shared UI in a project generated from the Kevairy template.
4
+ ---
5
+
6
+ # Kevairy UI
7
+
8
+ ## Workflow
9
+
10
+ 1. Read [the component catalog](references/component-catalog.md) before choosing shared UI building blocks.
11
+ 2. Inspect `package.json` for the installed `@kevairy/components` version.
12
+ 3. Search the project for an existing page pattern or component before adding a new abstraction. Prefer examples under `src/views/examples` and existing components under `src/components`.
13
+ 4. Select implementations in this order:
14
+ - Use `@kevairy/components` for reusable business UI, tables, search, dialogs, status, and shared data-display patterns.
15
+ - Reuse existing `Art*` components for template-specific layout, navigation, authentication, and application shell behavior.
16
+ - Compose Element Plus primitives only when the first two layers do not provide the required behavior.
17
+ - Create a local component only for project-specific behavior or a documented capability gap.
18
+ 5. Verify exact APIs in the [online component documentation](https://kevairy.top/components/) or the installed package types. Do not guess props, slots, events, exposed methods, or request contracts.
19
+ 6. Keep `@kevairy/components/style.css` imported once in `src/main.ts`; do not import it in individual pages.
20
+ 7. Run focused tests and `pnpm typecheck`. Run `pnpm build` when changing dependencies, shared UI composition, or build-facing code.
21
+
22
+ ## Source-of-truth rules
23
+
24
+ - Treat the installed package exports and type declarations as authoritative for the project's pinned version.
25
+ - Treat `https://kevairy.top/components/` as the usage and API guide for the latest published documentation.
26
+ - When documentation and installed types differ, implement against the installed version and state the mismatch.
27
+ - Import UI components and their types from `@kevairy/components`.
28
+ - Import non-UI composables, contracts, and pure utilities from `@kevairy/components/core` when the module should avoid UI dependencies.
29
+ - Avoid wrappers that merely rename a Kevairy component without adding project-specific behavior.
30
+
31
+ ## Documentation routing
32
+
33
+ - Components: `https://kevairy.top/components/`
34
+ - Template architecture and project patterns: `https://kevairy.top/template/`
35
+ - Scaffold usage: `https://kevairy.top/scaffold/`
36
+ - Use the local catalog for selection, then open only the relevant online API page.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: 'Kevairy UI'
3
+ short_description: '优先使用 Kevairy 组件与页面模式开发 Vue 后台'
4
+ default_prompt: 'Use $kevairy-ui to build this Vue admin UI with the appropriate Kevairy components.'
@@ -0,0 +1,45 @@
1
+ # Kevairy component catalog
2
+
3
+ Use this catalog to choose a capability before reading its exact API documentation. Check the installed `@kevairy/components` version before implementation.
4
+
5
+ ## Selection order
6
+
7
+ 1. Prefer a complete Kevairy page or pattern component.
8
+ 2. Compose lower-level Kevairy components when the complete pattern is too opinionated.
9
+ 3. Reuse existing template `Art*` components for application-shell concerns.
10
+ 4. Use Element Plus primitives for uncovered low-level behavior.
11
+ 5. Add a local component only for project-specific behavior or a documented gap.
12
+
13
+ ## Components
14
+
15
+ | Need | Prefer | Documentation |
16
+ | --- | --- | --- |
17
+ | Complete searchable and pageable list page | `KvSearchTablePage` | https://kevairy.top/components/api/kv-search-table-page |
18
+ | Search and table composition with custom state control | `KvSearchTable` | https://kevairy.top/components/api/kv-search-table |
19
+ | Base table rendering | `KvTable` | https://kevairy.top/components/api/kv-table |
20
+ | Column visibility, density, refresh, and fullscreen controls | `KvTableToolbar` | https://kevairy.top/components/api/kv-table-toolbar |
21
+ | Config-driven search form | `KvSearchBar` | https://kevairy.top/components/api/kv-search-bar |
22
+ | Draggable or resizable dialog | `KvDialog` | https://kevairy.top/components/api/kv-dialog |
23
+ | Dictionary value as a styled tag | `KvDictTag` | https://kevairy.top/components/api/kv-dict-tag |
24
+ | Section heading with optional actions | `KvSectionTitle` | https://kevairy.top/components/api/kv-section-title |
25
+ | Loading, empty, error, or other feedback state | `KvStatus` | https://kevairy.top/components/api/kv-status |
26
+ | Expandable card collection | `KvExpandableCardList` | https://kevairy.top/components/api/kv-expandable-card-list |
27
+ | Inline text difference display | `KvInlineDiff` | https://kevairy.top/components/api/kv-inline-diff |
28
+
29
+ ## Composables and utilities
30
+
31
+ | Need | Prefer | Documentation |
32
+ | --- | --- | --- |
33
+ | Pageable request state without the complete page UI | `usePagedTable` | https://kevairy.top/components/composables/use-paged-table |
34
+ | Normalize or remove empty search values | Search parameter utilities | https://kevairy.top/components/utilities/search-params |
35
+ | Calculate responsive form or grid spans | Responsive utilities | https://kevairy.top/components/utilities/responsive |
36
+
37
+ Import non-UI capabilities from `@kevairy/components/core` when the consumer should not resolve UI and drag dependencies.
38
+
39
+ ## Page patterns
40
+
41
+ - Search-table page organization: https://kevairy.top/template/page-patterns/search-table
42
+ - Template architecture and extension boundaries: https://kevairy.top/template/architecture
43
+ - Component installation and imports: https://kevairy.top/components/getting-started
44
+
45
+ For a standard list page, start with `KvSearchTablePage` and split business configuration into search configuration, table-column configuration, and a service adapter. Preserve the request result contract `{ records, total }` unless the installed API says otherwise.
@@ -0,0 +1,15 @@
1
+ # Kevairy 项目开发指南
2
+
3
+ ## UI 开发
4
+
5
+ - 创建、修改、审查或重构页面、表单、表格、搜索、弹窗、状态展示和公共 UI 时,必须使用 `$kevairy-ui` Skill。
6
+ - 开始实现前先检查 `@kevairy/components` 是否已有对应能力,不要重复实现通用组件。
7
+ - 通用业务 UI 优先使用 `@kevairy/components`;布局、导航、认证等模板框架能力优先复用现有 `Art*` 组件;两者均不满足时才直接组合 Element Plus 或创建项目级组件。
8
+ - 不要凭记忆猜测 Props、Slots、Events、Expose 或类型。先查看 [Kevairy 组件文档](https://kevairy.top/components/),再核对当前安装版本导出的类型。
9
+ - 在线文档与当前安装版本不一致时,以 `package.json` 中的版本及其类型声明为准。
10
+ - `@kevairy/components/style.css` 只在应用入口导入一次,页面中不要重复导入。
11
+
12
+ ## 验证
13
+
14
+ - 修改完成后运行与变更相称的检查,至少包含 `pnpm typecheck`。
15
+ - 涉及构建、依赖或公共组件组合时,同时运行相关测试和 `pnpm build`。
@@ -6,6 +6,7 @@ dist-ssr
6
6
  *.local
7
7
  .tmp-audit/
8
8
  .cursorrules
9
+ local-docs/
9
10
 
10
11
  # Auto-generated files
11
12
  **/src/types/import/auto-imports.d.ts
@@ -12,7 +12,7 @@
12
12
  "@e965/xlsx": "0.20.3",
13
13
  "@element-plus/icons-vue": "2.3.2",
14
14
  "@iconify/vue": "5.0.1",
15
- "@kevairy/components": "0.2.0",
15
+ "@kevairy/components": "0.2.1",
16
16
  "@tailwindcss/vite": "4.3.3",
17
17
  "@vueuse/core": "13.9.0",
18
18
  "@wangeditor/editor": "5.1.23",
@@ -1,14 +1,12 @@
1
1
  <!-- 授权页右上角组件 -->
2
2
  <template>
3
- <div
4
- class="absolute w-full flex-cb top-4.5 z-10 flex-c !justify-end max-[1180px]:!justify-between"
5
- >
6
- <div class="flex-cc !hidden max-[1180px]:!flex ml-2 max-sm:ml-6">
3
+ <div class="auth-top-bar">
4
+ <div class="auth-top-brand">
7
5
  <ArtLogo class="icon" size="46" />
8
- <h1 class="text-xl ont-mediumf ml-2">{{ AppConfig.systemInfo.name }}</h1>
6
+ <h1>{{ AppConfig.systemInfo.name }}</h1>
9
7
  </div>
10
8
 
11
- <div class="flex-cc gap-1.5 mr-2 max-sm:mr-5">
9
+ <div class="auth-top-actions">
12
10
  <div class="color-picker-expandable relative flex-c max-sm:!hidden">
13
11
  <div
14
12
  class="color-dots absolute right-0 rounded-full flex-c gap-2 rounded-5 px-2.5 py-2 pr-9 pl-2.5 opacity-0"
@@ -105,6 +103,36 @@
105
103
  </script>
106
104
 
107
105
  <style scoped>
106
+ .auth-top-bar {
107
+ position: absolute;
108
+ top: 18px;
109
+ z-index: 10;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: flex-end;
113
+ width: 100%;
114
+ }
115
+
116
+ .auth-top-brand {
117
+ display: none;
118
+ align-items: center;
119
+ margin-left: 8px;
120
+ }
121
+
122
+ .auth-top-brand h1 {
123
+ margin-left: 8px;
124
+ font-size: 20px;
125
+ font-weight: 500;
126
+ }
127
+
128
+ .auth-top-actions {
129
+ display: flex;
130
+ gap: 6px;
131
+ align-items: center;
132
+ justify-content: center;
133
+ margin-right: 8px;
134
+ }
135
+
108
136
  .color-dots {
109
137
  pointer-events: none;
110
138
  box-shadow: 0 2px 12px var(--art-gray-300);
@@ -146,4 +174,26 @@
146
174
  .color-picker-expandable:hover .palette-btn :deep(.art-svg-icon) {
147
175
  color: v-bind(color);
148
176
  }
177
+
178
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
179
+ @media (max-width: 1180px) {
180
+ .auth-top-bar {
181
+ justify-content: space-between;
182
+ }
183
+
184
+ .auth-top-brand {
185
+ display: flex;
186
+ }
187
+ }
188
+
189
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
190
+ @media (max-width: 639px) {
191
+ .auth-top-brand {
192
+ margin-left: 24px;
193
+ }
194
+
195
+ .auth-top-actions {
196
+ margin-right: 20px;
197
+ }
198
+ }
149
199
  </style>
@@ -86,13 +86,6 @@
86
86
  $primary-light-7: var(--el-color-primary-light-7);
87
87
  $primary-light-8: var(--el-color-primary-light-8);
88
88
  $primary-light-9: var(--el-color-primary-light-9);
89
- $primary-base: var(--el-color-primary);
90
- $main-bg: var(--default-box-color);
91
-
92
- // 混合颜色函数
93
- $bg-mix-light-9: color-mix(in srgb, $primary-light-9 100%, $main-bg);
94
- $bg-mix-light-8: color-mix(in srgb, $primary-light-8 80%, $main-bg);
95
- $bg-mix-light-7: color-mix(in srgb, $primary-light-7 80%, $main-bg);
96
89
 
97
90
  .login-left-view {
98
91
  position: relative;
@@ -101,7 +94,7 @@
101
94
  height: 100%;
102
95
  padding: 15px;
103
96
  overflow: hidden;
104
- background-color: $bg-mix-light-9;
97
+ background-color: $primary-light-9;
105
98
 
106
99
  .logo {
107
100
  position: relative;
@@ -327,7 +320,7 @@
327
320
  left: 16%;
328
321
  width: 60px;
329
322
  height: 60px;
330
- background-color: $bg-mix-light-8;
323
+ background-color: $primary-light-8;
331
324
 
332
325
  &.animate-fade-in-left {
333
326
  animation-name: fadeInLeftRotated;
@@ -351,7 +344,7 @@
351
344
  width: 50px;
352
345
  height: 50px;
353
346
  cursor: pointer;
354
- background: $bg-mix-light-7;
347
+ background: $primary-light-7;
355
348
  border-radius: 50%;
356
349
  transition: all 0.3s;
357
350
 
@@ -396,7 +389,7 @@
396
389
  right: -120px;
397
390
  width: 360px;
398
391
  height: 360px;
399
- background-color: $bg-mix-light-8;
392
+ background-color: $primary-light-8;
400
393
  border-radius: 50%;
401
394
  }
402
395
 
@@ -445,7 +438,7 @@
445
438
  z-index: 2;
446
439
  width: 50px;
447
440
  height: 50px;
448
- background-color: rgb(from $primary-base r g b / 30%);
441
+ background-color: var(--el-color-primary-light-7);
449
442
  }
450
443
 
451
444
  &.square-pink {
@@ -454,7 +447,7 @@
454
447
  z-index: 1;
455
448
  width: 70px;
456
449
  height: 70px;
457
- background-color: rgb(from $primary-base r g b / 15%);
450
+ background-color: var(--el-color-primary-light-8);
458
451
  }
459
452
 
460
453
  &.square-purple {
@@ -463,7 +456,7 @@
463
456
  z-index: 3;
464
457
  width: 32px;
465
458
  height: 32px;
466
- background-color: rgb(from $primary-base r g b / 45%);
459
+ background-color: var(--el-color-primary-light-6);
467
460
  }
468
461
  }
469
462
 
@@ -484,7 +477,8 @@
484
477
  }
485
478
  }
486
479
 
487
- @media only screen and (width <= 1600px) {
480
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
481
+ @media only screen and (max-width: 1600px) {
488
482
  width: 60vw;
489
483
 
490
484
  .text-wrap {
@@ -492,39 +486,27 @@
492
486
  }
493
487
  }
494
488
 
495
- @media only screen and (width <= 1180px) {
496
- width: auto;
497
- height: auto;
498
- padding: 0;
499
- // 隐藏背景和其他内容,只保留 logo
500
- background: transparent;
501
-
502
- .left-img,
503
- .text-wrap,
504
- .geometric-decorations {
505
- display: none;
506
- }
507
-
508
- .logo {
509
- display: none;
510
- }
489
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
490
+ @media only screen and (max-width: 1180px) {
491
+ display: none;
511
492
  }
512
493
  }
513
494
 
514
495
  // 暗色主题
515
496
  .dark .login-left-view {
516
- background-color: color-mix(in srgb, $primary-light-9 60%, #070707);
497
+ background-color: var(--el-bg-color-page, #070707);
517
498
 
518
- @media only screen and (width <= 1180px) {
519
- background: transparent;
499
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
500
+ @media only screen and (max-width: 1180px) {
501
+ display: none;
520
502
  }
521
503
 
522
504
  .geometric-decorations {
523
505
  // 月亮效果
524
506
  .circle-top-right {
525
- background-color: $bg-mix-light-8;
507
+ background-color: $primary-light-8;
526
508
  box-shadow: 0 0 25px #333 inset;
527
- rotate: -48deg;
509
+ transform: rotate(-48deg);
528
510
  transition: all 0.3s ease-in-out 0.1s;
529
511
 
530
512
  &::before {
@@ -534,7 +516,7 @@
534
516
  width: 50px;
535
517
  height: 50px;
536
518
  content: '';
537
- background-color: $bg-mix-light-9;
519
+ background-color: $primary-light-9;
538
520
  border-radius: 50%;
539
521
  transition: all 0.3s ease-in-out;
540
522
  }
@@ -554,12 +536,12 @@
554
536
  }
555
537
 
556
538
  .bg-bubble {
557
- background-color: $bg-mix-light-9;
539
+ background-color: $primary-light-9;
558
540
  }
559
541
 
560
542
  // 其他元素颜色调整
561
543
  .square-rotated {
562
- background-color: $bg-mix-light-9;
544
+ background-color: $primary-light-9;
563
545
  }
564
546
 
565
547
  .circle-small,
@@ -582,15 +564,15 @@
582
564
  box-shadow: none;
583
565
 
584
566
  &.square-blue {
585
- background-color: rgb(from $primary-base r g b / 18%);
567
+ background-color: var(--el-color-primary-light-8);
586
568
  }
587
569
 
588
570
  &.square-pink {
589
- background-color: rgb(from $primary-base r g b / 10%);
571
+ background-color: var(--el-color-primary-light-9);
590
572
  }
591
573
 
592
574
  &.square-purple {
593
- background-color: rgb(from $primary-base r g b / 20%);
575
+ background-color: var(--el-color-primary-light-7);
594
576
  }
595
577
  }
596
578
 
@@ -4,6 +4,7 @@ import { initStore } from './store' // Store
4
4
  import { initRouter } from './router' // Router
5
5
  import language from './locales' // 国际化
6
6
  import '@styles/core/tailwind.css' // tailwind
7
+ import 'element-plus/dist/index.css' // Element Plus 基础样式(覆盖组件包内部依赖)
7
8
  import '@styles/index.scss' // 样式
8
9
  import '@kevairy/components/style.css' // 公共组件样式
9
10
  import '@utils/sys/console.ts' // 控制台输出内容
@@ -1,9 +1,9 @@
1
1
  <!-- 通用模板登录页面:当前使用本地 Mock,后续项目只需替换认证适配层。 -->
2
2
  <template>
3
- <div class="flex w-full h-screen">
3
+ <main class="auth-page">
4
4
  <LoginLeftView />
5
5
 
6
- <div class="relative flex-1">
6
+ <section class="auth-right-panel">
7
7
  <AuthTopBar />
8
8
 
9
9
  <div class="auth-right-wrap">
@@ -64,8 +64,8 @@
64
64
  </ElForm>
65
65
  </div>
66
66
  </div>
67
- </div>
68
- </div>
67
+ </section>
68
+ </main>
69
69
  </template>
70
70
 
71
71
  <script setup lang="ts">
@@ -1,26 +1,86 @@
1
- @reference '@styles/core/tailwind.css';
1
+ /* 授权页布局:保留 vh 回退,避免旧 Chromium 忽略新视口单位。 */
2
+ .auth-page {
3
+ display: flex;
4
+ width: 100%;
5
+ height: 100vh;
6
+ min-height: 100vh;
7
+ overflow: hidden;
8
+ }
9
+
10
+ .auth-right-panel {
11
+ position: relative;
12
+ flex: 1 1 0;
13
+ min-width: 0;
14
+ height: 100%;
15
+ }
2
16
 
3
- /* 授权页右侧区域 */
4
17
  .auth-right-wrap {
5
- @apply absolute inset-0 w-[440px] h-[650px] py-[5px] m-auto overflow-hidden
6
- max-sm:px-7 max-sm:w-full
7
- animate-[slideInRight_0.6s_cubic-bezier(0.25,0.46,0.45,0.94)_forwards]
8
- max-md:animate-none;
18
+ box-sizing: border-box;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ width: 100%;
23
+ height: 100%;
24
+ padding: 72px 32px 32px;
25
+ overflow-x: hidden;
26
+ /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties -- Keep an old Chromium-compatible overflow fallback. */
27
+ overflow-y: auto;
28
+ animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
29
+ }
30
+
31
+ .auth-right-wrap .form {
32
+ width: 100%;
33
+ max-width: 440px;
34
+ padding: 40px 0;
35
+ }
36
+
37
+ .auth-right-wrap .title {
38
+ font-size: 36px;
39
+ font-weight: 600;
40
+ color: var(--art-gray-900);
41
+ }
9
42
 
10
- .form {
11
- @apply h-full py-[40px];
43
+ .auth-right-wrap .sub-title {
44
+ margin-top: 10px;
45
+ font-size: 14px;
46
+ color: var(--art-gray-600);
47
+ }
48
+
49
+ .auth-right-wrap .custom-height {
50
+ height: 40px !important;
51
+ }
52
+
53
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
54
+ @media (max-width: 767px) {
55
+ .auth-right-wrap {
56
+ padding-right: 28px;
57
+ padding-left: 28px;
58
+ animation: none;
12
59
  }
13
60
 
14
- .title {
15
- @apply text-g-900 text-4xl font-semibold max-md:text-3xl max-sm:pt-10;
61
+ .auth-right-wrap .title {
62
+ font-size: 30px;
16
63
  }
64
+ }
65
+
66
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
67
+ @media (max-width: 639px) {
68
+ .auth-right-wrap {
69
+ padding-right: 28px;
70
+ padding-left: 28px;
71
+ }
72
+ }
17
73
 
18
- .sub-title {
19
- @apply mt-[10px] text-g-600 text-sm;
74
+ /* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
75
+ @media (max-height: 720px) {
76
+ .auth-right-wrap {
77
+ align-items: flex-start;
78
+ padding-top: 56px;
20
79
  }
21
80
 
22
- .custom-height {
23
- @apply !h-[40px];
81
+ .auth-right-wrap .form {
82
+ padding-top: 24px;
83
+ padding-bottom: 24px;
24
84
  }
25
85
  }
26
86
 
@@ -12,3 +12,35 @@ test('redirects anonymous users and signs in to the configured home page', async
12
12
  await expect(page.getByRole('heading', { name: __DISPLAY_NAME_LITERAL__ })).toBeVisible()
13
13
  await expect(page).toHaveTitle(/__DISPLAY_NAME_REGEX__/)
14
14
  })
15
+
16
+ test('keeps the login form usable in a short compatibility viewport', async ({ page }) => {
17
+ await page.setViewportSize({ width: 1024, height: 600 })
18
+ await page.goto('/#/auth/login')
19
+
20
+ const metrics = await page.evaluate(() => {
21
+ const pageRoot = document.querySelector<HTMLElement>('.auth-page')
22
+ const panel = document.querySelector<HTMLElement>('.auth-right-panel')
23
+ const scroller = document.querySelector<HTMLElement>('.auth-right-wrap')
24
+ const form = document.querySelector<HTMLElement>('.auth-right-wrap .form')
25
+ const leftView = document.querySelector<HTMLElement>('.login-left-view')
26
+ const formRect = form?.getBoundingClientRect()
27
+
28
+ return {
29
+ pageWidth: pageRoot?.getBoundingClientRect().width ?? 0,
30
+ panelWidth: panel?.getBoundingClientRect().width ?? 0,
31
+ formWidth: formRect?.width ?? 0,
32
+ formLeft: formRect?.left ?? -1,
33
+ formRight: formRect?.right ?? Number.POSITIVE_INFINITY,
34
+ scrollable: (scroller?.scrollHeight ?? 0) >= (scroller?.clientHeight ?? 0),
35
+ leftViewDisplay: leftView ? getComputedStyle(leftView).display : null
36
+ }
37
+ })
38
+
39
+ expect(metrics.leftViewDisplay).toBe('none')
40
+ expect(metrics.panelWidth).toBe(metrics.pageWidth)
41
+ expect(metrics.formWidth).toBeLessThanOrEqual(440)
42
+ expect(metrics.formLeft).toBeGreaterThanOrEqual(0)
43
+ expect(metrics.formRight).toBeLessThanOrEqual(metrics.pageWidth)
44
+ expect(metrics.scrollable).toBe(true)
45
+ await expect(page.getByRole('button', { name: '进入系统(Mock)' })).toBeVisible()
46
+ })
@@ -22,6 +22,8 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
22
22
  const searchTablePage = document.querySelector<HTMLElement>('.search-table-page')
23
23
  const pagination = document.querySelector<HTMLElement>('.kv-table .pagination')
24
24
  const toolbarButton = document.querySelector<HTMLElement>('.toolbar-button')
25
+ const elementTable = document.querySelector<HTMLElement>('.kv-table .el-table')
26
+ const elementPagination = document.querySelector<HTMLElement>('.kv-table .el-pagination')
25
27
  const toolbarButtonRect = toolbarButton?.getBoundingClientRect()
26
28
 
27
29
  return {
@@ -37,7 +39,11 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
37
39
  paginationClientWidth: pagination?.clientWidth ?? 0,
38
40
  paginationScrollWidth: pagination?.scrollWidth ?? 0,
39
41
  toolbarButtonWidth: toolbarButtonRect?.width ?? 0,
40
- toolbarButtonHeight: toolbarButtonRect?.height ?? 0
42
+ toolbarButtonHeight: toolbarButtonRect?.height ?? 0,
43
+ elementTablePosition: elementTable ? getComputedStyle(elementTable).position : null,
44
+ elementPaginationDisplay: elementPagination
45
+ ? getComputedStyle(elementPagination).display
46
+ : null
41
47
  }
42
48
  })
43
49
 
@@ -48,6 +54,8 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
48
54
  expect(layout.paginationScrollWidth).toBeLessThanOrEqual(layout.paginationClientWidth)
49
55
  expect(layout.toolbarButtonWidth).toBe(32)
50
56
  expect(layout.toolbarButtonHeight).toBe(32)
57
+ expect(layout.elementTablePosition).toBe('relative')
58
+ expect(layout.elementPaginationDisplay).toBe('flex')
51
59
 
52
60
  const keyword = page.getByPlaceholder('服务名称或编码')
53
61
  await keyword.fill('SERVICE_001')
@@ -4,7 +4,6 @@ import path from 'path'
4
4
  import { fileURLToPath } from 'url'
5
5
  import Components from 'unplugin-vue-components/vite'
6
6
  import AutoImport from 'unplugin-auto-import/vite'
7
- import ElementPlus from 'unplugin-element-plus/vite'
8
7
  import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
9
8
  import tailwindcss from '@tailwindcss/vite'
10
9
  // import { visualizer } from 'rollup-plugin-visualizer'
@@ -72,7 +71,7 @@ export default ({ mode }: { mode: string }) => {
72
71
  AutoImport({
73
72
  imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
74
73
  dts: 'src/types/import/auto-imports.d.ts',
75
- resolvers: [ElementPlusResolver({ importStyle: 'css' })],
74
+ resolvers: [ElementPlusResolver({ importStyle: false })],
76
75
  eslintrc: {
77
76
  enabled: true,
78
77
  filepath: './eslint-auto-import.json',
@@ -82,11 +81,7 @@ export default ({ mode }: { mode: string }) => {
82
81
  // 自动按需导入组件
83
82
  Components({
84
83
  dts: 'src/types/import/components.d.ts',
85
- resolvers: [ElementPlusResolver({ importStyle: 'css' })]
86
- }),
87
- // 按需定制主题配置
88
- ElementPlus({
89
- useSource: false
84
+ resolvers: [ElementPlusResolver({ importStyle: false })]
90
85
  })
91
86
  // 打包分析
92
87
  // visualizer({