gy-ui-plus 1.0.16 → 1.0.20
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/.editorconfig +8 -0
- package/.gitattributes +1 -0
- package/.prettierignore +21 -0
- package/.prettierrc.json +11 -0
- package/.vscode/extensions.json +9 -0
- package/MONOREPO.md +103 -0
- package/README.md +241 -0
- package/deploy.yml +30 -0
- package/docs/.vitepress/cache/deps/@element-plus_icons-vue.js +5472 -0
- package/docs/.vitepress/cache/deps/@element-plus_icons-vue.js.map +7 -0
- package/docs/.vitepress/cache/deps/@highlightjs_vue-plugin_dist_highlightjs-vue__esm__min__js.js +53 -0
- package/docs/.vitepress/cache/deps/@highlightjs_vue-plugin_dist_highlightjs-vue__esm__min__js.js.map +7 -0
- package/docs/.vitepress/cache/deps/_metadata.json +82 -0
- package/docs/.vitepress/cache/deps/chunk-G3PMV62Z.js +36 -0
- package/docs/.vitepress/cache/deps/chunk-G3PMV62Z.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-LFZJEN3U.js +1546 -0
- package/docs/.vitepress/cache/deps/chunk-LFZJEN3U.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-SW5CTN4G.js +9172 -0
- package/docs/.vitepress/cache/deps/chunk-SW5CTN4G.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-W5AQ4OLI.js +12824 -0
- package/docs/.vitepress/cache/deps/chunk-W5AQ4OLI.js.map +7 -0
- package/docs/.vitepress/cache/deps/echarts.js +75413 -0
- package/docs/.vitepress/cache/deps/echarts.js.map +7 -0
- package/docs/.vitepress/cache/deps/element-plus.js +77975 -0
- package/docs/.vitepress/cache/deps/element-plus.js.map +7 -0
- package/docs/.vitepress/cache/deps/element-plus_es_locale_lang_zh-cn.js +201 -0
- package/docs/.vitepress/cache/deps/element-plus_es_locale_lang_zh-cn.js.map +7 -0
- package/docs/.vitepress/cache/deps/highlight__js_lib_common.js +12558 -0
- package/docs/.vitepress/cache/deps/highlight__js_lib_common.js.map +7 -0
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/.vitepress/cache/deps/sortablejs.js +2781 -0
- package/docs/.vitepress/cache/deps/sortablejs.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4507 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +568 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps/vue.js +348 -0
- package/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/chunk-W5AQ4OLI.js +12824 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/chunk-W5AQ4OLI.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/package.json +3 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vue_devtools-api.js +4505 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vueuse_core.js +9184 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vue.js +347 -0
- package/docs/.vitepress/cache/deps_temp_17f22fad/vue.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/chunk-W5AQ4OLI.js +12824 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/chunk-W5AQ4OLI.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/package.json +3 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vue_devtools-api.js +4505 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vueuse_core.js +9184 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vue.js +347 -0
- package/docs/.vitepress/cache/deps_temp_35eb88f5/vue.js.map +7 -0
- package/docs/.vitepress/components/TIcon.vue +13 -0
- package/docs/.vitepress/components/TTip.vue +35 -0
- package/docs/.vitepress/components/TVHtml.vue +12 -0
- package/docs/.vitepress/config.ts +45 -0
- package/docs/.vitepress/plugins/mdPlugin.ts +46 -0
- package/docs/.vitepress/theme/components/docs-code-demo.vue +212 -0
- package/docs/.vitepress/theme/components/layout.vue +73 -0
- package/docs/.vitepress/theme/directives/index.ts +43 -0
- package/docs/.vitepress/theme/index.ts +49 -0
- package/docs/.vitepress/theme/styles/code.scss +59 -0
- package/docs/.vitepress/theme/styles/index.scss +150 -0
- package/docs/.vitepress/utils/getComponent.ts +4 -0
- package/docs/.vitepress/utils/highlight.ts +16 -0
- package/docs/.vitepress/utils/index.ts +13 -0
- package/docs/.vitepress/utils/utils.ts +940 -0
- package/docs/components/gy-button.md +38 -0
- package/docs/components/gy-table.md +539 -0
- package/docs/examples/GyButton/base.vue +39 -0
- package/docs/examples/GyButton/isDebounce.vue +46 -0
- package/docs/examples/GyButton/tip.vue +27 -0
- package/docs/examples/GyTable/align.vue +142 -0
- package/docs/examples/GyTable/base.vue +60 -0
- package/docs/examples/GyTable/border.vue +60 -0
- package/docs/examples/GyTable/borderCom.vue +61 -0
- package/docs/examples/GyTable/columnSetting.vue +82 -0
- package/docs/examples/GyTable/configEdit.vue +225 -0
- package/docs/examples/GyTable/configEditUse.vue +341 -0
- package/docs/examples/GyTable/data.json +284 -0
- package/docs/examples/GyTable/data2.json +284 -0
- package/docs/examples/GyTable/dept.json +1015 -0
- package/docs/examples/GyTable/echoSelectTable.vue +224 -0
- package/docs/examples/GyTable/editSingle.vue +161 -0
- package/docs/examples/GyTable/emptySlot.vue +31 -0
- package/docs/examples/GyTable/emptyText.vue +25 -0
- package/docs/examples/GyTable/eventHandle.vue +227 -0
- package/docs/examples/GyTable/expand.vue +99 -0
- package/docs/examples/GyTable/filterMethod.vue +71 -0
- package/docs/examples/GyTable/filters.vue +84 -0
- package/docs/examples/GyTable/footerSlot.vue +251 -0
- package/docs/examples/GyTable/formatter.vue +66 -0
- package/docs/examples/GyTable/headerCellStyle.vue +65 -0
- package/docs/examples/GyTable/isCopy.vue +60 -0
- package/docs/examples/GyTable/isRadioDisabled.vue +69 -0
- package/docs/examples/GyTable/isRowSortIcon.vue +83 -0
- package/docs/examples/GyTable/isShowCol.vue +66 -0
- package/docs/examples/GyTable/isShowColMultileHead.vue +84 -0
- package/docs/examples/GyTable/isShowPagination.vue +100 -0
- package/docs/examples/GyTable/menu.json +31466 -0
- package/docs/examples/GyTable/menu1.json +2889 -0
- package/docs/examples/GyTable/menuMange.vue +490 -0
- package/docs/examples/GyTable/multileHead.vue +155 -0
- package/docs/examples/GyTable/multileHeadEdit.vue +313 -0
- package/docs/examples/GyTable/multileHeadRenderHeader.vue +208 -0
- package/docs/examples/GyTable/multileHeadSort.vue +99 -0
- package/docs/examples/GyTable/operator.vue +147 -0
- package/docs/examples/GyTable/operatorBtn.vue +154 -0
- package/docs/examples/GyTable/operatorMore.vue +135 -0
- package/docs/examples/GyTable/operatorRender.vue +153 -0
- package/docs/examples/GyTable/operatorSlotName.vue +117 -0
- package/docs/examples/GyTable/pageCheck.vue +114 -0
- package/docs/examples/GyTable/paginationSlot.vue +104 -0
- package/docs/examples/GyTable/radio.vue +77 -0
- package/docs/examples/GyTable/radioDefault.vue +77 -0
- package/docs/examples/GyTable/radioIndex.vue +73 -0
- package/docs/examples/GyTable/render.vue +120 -0
- package/docs/examples/GyTable/renderHeader.vue +106 -0
- package/docs/examples/GyTable/rowSort.vue +67 -0
- package/docs/examples/GyTable/rules.vue +241 -0
- package/docs/examples/GyTable/rulesCol.vue +237 -0
- package/docs/examples/GyTable/rulesSelectTable.vue +256 -0
- package/docs/examples/GyTable/rulesSelectTableRefs.vue +261 -0
- package/docs/examples/GyTable/selection.vue +99 -0
- package/docs/examples/GyTable/selectionDisabled.vue +90 -0
- package/docs/examples/GyTable/selectionIndex.vue +137 -0
- package/docs/examples/GyTable/serialNum.vue +60 -0
- package/docs/examples/GyTable/showSummary.vue +65 -0
- package/docs/examples/GyTable/singleEditKeyup.vue +213 -0
- package/docs/examples/GyTable/size.vue +67 -0
- package/docs/examples/GyTable/slotName.vue +100 -0
- package/docs/examples/GyTable/slotNameMerge.vue +171 -0
- package/docs/examples/GyTable/sort.vue +58 -0
- package/docs/examples/GyTable/sortCellChange.vue +63 -0
- package/docs/examples/GyTable/sortMethod.vue +69 -0
- package/docs/examples/GyTable/sortable.vue +111 -0
- package/docs/examples/GyTable/stripe.vue +61 -0
- package/docs/examples/GyTable/summaryMethod.vue +92 -0
- package/docs/examples/GyTable/tableLoading.vue +131 -0
- package/docs/examples/GyTable/treeMenuTable.vue +161 -0
- package/docs/examples/GyTable/treeTable.vue +118 -0
- package/docs/examples/GyTable/tselecttabledata.json +102 -0
- package/docs/examples/GyTable/useVirtual.vue +54 -0
- package/docs/index.md +40 -0
- package/docs/package-lock.json +5898 -0
- package/docs/package.json +52 -0
- package/eslint.config.ts +39 -0
- package/index.html +28 -0
- package/package.json +16 -40
- package/packages/button/index.ts +5 -0
- package/packages/button/package.json +19 -0
- package/packages/button/src/index.vue +41 -0
- package/packages/button/src/type.ts +11 -0
- package/packages/core/package.json +18 -0
- package/packages/core/withInstall.ts +21 -0
- package/packages/gy-ui-plus/package.json +78 -0
- package/packages/gy-ui-plus/tsconfig.json +16 -0
- package/packages/gy-ui-plus/vite.config.ts +71 -0
- package/packages/index.ts +37 -0
- package/packages/layout-page/index.ts +6 -0
- package/packages/layout-page/package.json +19 -0
- package/packages/layout-page/src/index.vue +75 -0
- package/packages/layout-page/style/index.ts +1 -0
- package/packages/layout-page/style/layout-page.scss +38 -0
- package/packages/table/index.ts +7 -0
- package/packages/table/package.json +19 -0
- package/packages/table/src/ColumnSet.vue +170 -0
- package/packages/table/src/GyTableColumn.vue +100 -0
- package/packages/table/src/index.vue +1088 -0
- package/packages/table/src/operator.vue +203 -0
- package/packages/table/src/renderCol.vue +20 -0
- package/packages/table/src/renderHeader.vue +18 -0
- package/packages/table/src/singleEdit.vue +352 -0
- package/packages/table/src/singleEditCell.vue +301 -0
- package/packages/table/src/tableProps.ts +167 -0
- package/packages/table/src/useExpose.ts +74 -0
- package/packages/table/src/useVirtualized.ts +70 -0
- package/packages/table/style/index.ts +1 -0
- package/packages/table/style/table.scss +346 -0
- package/pnpm-workspace.yaml +3 -0
- package/public/favicon.ico +0 -0
- package/tsconfig.app.json +23 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +19 -0
- package/typings/env.d.ts +24 -0
- package/typings/index.d.ts +159 -0
- package/dist/gy-ui-plus.es.js +0 -4660
- package/dist/gy-ui-plus.umd.js +0 -2
- package/dist/packages/button/index.d.ts +0 -109
- package/dist/packages/button/src/index.vue.d.ts +0 -52
- package/dist/packages/button/src/type.d.ts +0 -11
- package/dist/packages/core/withInstall.d.ts +0 -5
- package/dist/packages/gy-ui-plus/__VLS_types.d.ts +0 -124
- package/dist/packages/gy-ui-plus/dist/packages/button/index.d.ts +0 -109
- package/dist/packages/gy-ui-plus/dist/packages/button/src/index.vue.d.ts +0 -53
- package/dist/packages/gy-ui-plus/dist/packages/button/src/type.d.ts +0 -12
- package/dist/packages/gy-ui-plus/dist/packages/core/withInstall.d.ts +0 -6
- package/dist/packages/gy-ui-plus/dist/packages/gy-ui-plus/__VLS_types.d.ts +0 -124
- package/dist/packages/gy-ui-plus/dist/packages/gy-ui-plus/vite.config.d.ts +0 -2
- package/dist/packages/gy-ui-plus/dist/packages/index.d.ts +0 -10
- package/dist/packages/gy-ui-plus/dist/packages/layout-page/index.d.ts +0 -84
- package/dist/packages/gy-ui-plus/dist/packages/layout-page/src/index.vue.d.ts +0 -49
- package/dist/packages/gy-ui-plus/dist/packages/layout-page/style/index.d.ts +0 -1
- package/dist/packages/gy-ui-plus/dist/packages/table/index.d.ts +0 -616
- package/dist/packages/gy-ui-plus/dist/packages/table/src/ColumnSet.vue.d.ts +0 -52
- package/dist/packages/gy-ui-plus/dist/packages/table/src/GyTableColumn.vue.d.ts +0 -46
- package/dist/packages/gy-ui-plus/dist/packages/table/src/index.vue.d.ts +0 -344
- package/dist/packages/gy-ui-plus/dist/packages/table/src/operator.vue.d.ts +0 -41
- package/dist/packages/gy-ui-plus/dist/packages/table/src/renderCol.vue.d.ts +0 -20
- package/dist/packages/gy-ui-plus/dist/packages/table/src/renderHeader.vue.d.ts +0 -16
- package/dist/packages/gy-ui-plus/dist/packages/table/src/singleEdit.vue.d.ts +0 -96
- package/dist/packages/gy-ui-plus/dist/packages/table/src/singleEditCell.vue.d.ts +0 -97
- package/dist/packages/gy-ui-plus/dist/packages/table/src/tableProps.d.ts +0 -129
- package/dist/packages/gy-ui-plus/dist/packages/table/src/useExpose.d.ts +0 -16
- package/dist/packages/gy-ui-plus/dist/packages/table/src/useVirtualized.d.ts +0 -11
- package/dist/packages/gy-ui-plus/dist/packages/table/style/index.d.ts +0 -1
- package/dist/packages/gy-ui-plus/vite.config.d.ts +0 -2
- package/dist/packages/index.d.ts +0 -9
- package/dist/packages/layout-page/index.d.ts +0 -84
- package/dist/packages/layout-page/src/index.vue.d.ts +0 -49
- package/dist/packages/layout-page/style/index.d.ts +0 -1
- package/dist/packages/table/index.d.ts +0 -616
- package/dist/packages/table/src/ColumnSet.vue.d.ts +0 -52
- package/dist/packages/table/src/GyTableColumn.vue.d.ts +0 -46
- package/dist/packages/table/src/index.vue.d.ts +0 -344
- package/dist/packages/table/src/operator.vue.d.ts +0 -41
- package/dist/packages/table/src/renderCol.vue.d.ts +0 -20
- package/dist/packages/table/src/renderHeader.vue.d.ts +0 -16
- package/dist/packages/table/src/singleEdit.vue.d.ts +0 -96
- package/dist/packages/table/src/singleEditCell.vue.d.ts +0 -97
- package/dist/packages/table/src/tableProps.d.ts +0 -128
- package/dist/packages/table/src/useExpose.d.ts +0 -16
- package/dist/packages/table/src/useVirtualized.d.ts +0 -10
- package/dist/packages/table/style/index.d.ts +0 -1
package/.editorconfig
ADDED
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/MONOREPO.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Monorepo 架构说明
|
|
2
|
+
|
|
3
|
+
本项目已转换为 monorepo 架构,使用 pnpm workspace 进行管理。
|
|
4
|
+
|
|
5
|
+
## 项目结构
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
gy-ui-plus/
|
|
9
|
+
├── packages/
|
|
10
|
+
│ ├── core/ # 核心工具包(withInstall 等)
|
|
11
|
+
│ ├── button/ # Button 组件包
|
|
12
|
+
│ ├── table/ # Table 组件包
|
|
13
|
+
│ ├── layout-page/ # LayoutPage 组件包
|
|
14
|
+
│ ├── gy-ui-plus/ # 主构建包(用于构建发布版本)
|
|
15
|
+
│ └── index.ts # 主入口文件
|
|
16
|
+
├── docs/ # 文档站点
|
|
17
|
+
└── dist/ # 构建输出目录
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 包说明
|
|
21
|
+
|
|
22
|
+
### @gy-ui-plus/core
|
|
23
|
+
核心工具包,包含 `withInstall` 等通用工具函数。
|
|
24
|
+
|
|
25
|
+
### @gy-ui-plus/button
|
|
26
|
+
Button 组件包。
|
|
27
|
+
|
|
28
|
+
### @gy-ui-plus/table
|
|
29
|
+
Table 组件包。
|
|
30
|
+
|
|
31
|
+
### @gy-ui-plus/layout-page
|
|
32
|
+
LayoutPage 组件包。
|
|
33
|
+
|
|
34
|
+
### gy-ui-plus
|
|
35
|
+
主构建包,用于构建和发布整个组件库。
|
|
36
|
+
|
|
37
|
+
### @gy-ui-plus/docs
|
|
38
|
+
文档站点,使用 VitePress 构建。
|
|
39
|
+
|
|
40
|
+
## 常用命令
|
|
41
|
+
|
|
42
|
+
### 安装依赖
|
|
43
|
+
```bash
|
|
44
|
+
pnpm install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 构建组件库
|
|
48
|
+
```bash
|
|
49
|
+
pnpm build
|
|
50
|
+
# 或
|
|
51
|
+
pnpm lib
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 开发文档
|
|
55
|
+
```bash
|
|
56
|
+
pnpm docs:dev
|
|
57
|
+
# 或
|
|
58
|
+
pnpm dev
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 构建文档
|
|
62
|
+
```bash
|
|
63
|
+
pnpm docs:build
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 预览文档
|
|
67
|
+
```bash
|
|
68
|
+
pnpm docs:preview
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 类型检查
|
|
72
|
+
```bash
|
|
73
|
+
pnpm type-check
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 代码检查
|
|
77
|
+
```bash
|
|
78
|
+
pnpm lint
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 代码格式化
|
|
82
|
+
```bash
|
|
83
|
+
pnpm format
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 工作空间依赖
|
|
87
|
+
|
|
88
|
+
在 monorepo 中,包之间使用 `workspace:*` 协议来引用本地包:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@gy-ui-plus/core": "workspace:*"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 注意事项
|
|
99
|
+
|
|
100
|
+
1. 必须使用 pnpm 作为包管理器(已通过 `preinstall` 脚本强制)
|
|
101
|
+
2. 所有包都通过 workspace 协议相互引用
|
|
102
|
+
3. 构建输出在根目录的 `dist` 文件夹
|
|
103
|
+
4. 每个包都有独立的 `package.json`,但共享根目录的依赖
|
package/README.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# gy-ui-plus
|
|
2
|
+
|
|
3
|
+
一个基于 Vue 3 + Element Plus 二次封装的企业级 UI 组件库,提供高质量的封装组件,帮助开发者快速构建复杂的前端应用。
|
|
4
|
+
|
|
5
|
+
## 特性
|
|
6
|
+
|
|
7
|
+
- 基于 Vue 3 + TypeScript 开发,提供完整的类型定义
|
|
8
|
+
- 基于 Element Plus 深度封装,保持良好兼容性
|
|
9
|
+
- 支持按需引入,减小打包体积
|
|
10
|
+
- 提供 LayoutPage、Table、Button 等常用业务组件
|
|
11
|
+
- 内置虚拟滚动、列设置、单行编辑等高级功能
|
|
12
|
+
- 完善的代码规范和自动化工具链
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
使用 npm、yarn 或 pnpm 安装:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install gy-ui-plus
|
|
20
|
+
# 或
|
|
21
|
+
yarn add gy-ui-plus
|
|
22
|
+
# 或
|
|
23
|
+
pnpm add gy-ui-plus
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 开发
|
|
27
|
+
|
|
28
|
+
本项目使用 monorepo 架构,基于 pnpm workspace 管理。详细说明请参考 [MONOREPO.md](./MONOREPO.md)。
|
|
29
|
+
|
|
30
|
+
### 开发环境要求
|
|
31
|
+
|
|
32
|
+
- Node.js: ^20.19.0 || >=22.12.0
|
|
33
|
+
- pnpm: >=8.0.0
|
|
34
|
+
|
|
35
|
+
### 本地开发
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# 安装依赖
|
|
39
|
+
pnpm install
|
|
40
|
+
|
|
41
|
+
# 开发文档站点
|
|
42
|
+
pnpm docs:dev
|
|
43
|
+
|
|
44
|
+
# 构建组件库
|
|
45
|
+
pnpm build
|
|
46
|
+
|
|
47
|
+
# 类型检查
|
|
48
|
+
pnpm type-check
|
|
49
|
+
|
|
50
|
+
# 代码检查
|
|
51
|
+
pnpm lint
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 快速开始
|
|
55
|
+
|
|
56
|
+
### 完整引入
|
|
57
|
+
|
|
58
|
+
在 main.ts 中引入组件库:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { createApp } from 'vue'
|
|
62
|
+
import App from './App.vue'
|
|
63
|
+
import GyUiPlus from 'gy-ui-plus'
|
|
64
|
+
import 'gy-ui-plus/dist/style.css'
|
|
65
|
+
|
|
66
|
+
const app = createApp(App)
|
|
67
|
+
app.use(GyUiPlus)
|
|
68
|
+
app.mount('#app')
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 按需引入
|
|
72
|
+
|
|
73
|
+
可以单独引入需要的组件:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { createApp } from 'vue'
|
|
77
|
+
import App from './App.vue'
|
|
78
|
+
import { GyButton, GyTable, GyLayoutPage } from 'gy-ui-plus'
|
|
79
|
+
import 'gy-ui-plus/dist/style.css'
|
|
80
|
+
|
|
81
|
+
const app = createApp(App)
|
|
82
|
+
app.component('GyButton', GyButton)
|
|
83
|
+
app.component('GyTable', GyTable)
|
|
84
|
+
app.component('GyLayoutPage', GyLayoutPage)
|
|
85
|
+
app.mount('#app')
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 组件列表
|
|
89
|
+
|
|
90
|
+
### GyLayoutPage
|
|
91
|
+
|
|
92
|
+
布局页面组件,提供标准的页面布局结构。
|
|
93
|
+
|
|
94
|
+
### GyTable
|
|
95
|
+
|
|
96
|
+
增强表格组件,支持:
|
|
97
|
+
|
|
98
|
+
- 虚拟滚动(大数据量优化)
|
|
99
|
+
- 列设置(显示/隐藏列)
|
|
100
|
+
- 单行编辑
|
|
101
|
+
- 自定义列渲染
|
|
102
|
+
- 操作列配置
|
|
103
|
+
|
|
104
|
+
### GyButton
|
|
105
|
+
|
|
106
|
+
增强按钮组件,提供更多业务场景的按钮样式和功能。
|
|
107
|
+
|
|
108
|
+
## 开发
|
|
109
|
+
|
|
110
|
+
### 环境要求
|
|
111
|
+
|
|
112
|
+
- Node.js >= 20.19.0
|
|
113
|
+
- npm >= 10.0.0
|
|
114
|
+
|
|
115
|
+
### 安装依赖
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 构建组件库
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npm run lib
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 代码检查和格式化
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# 运行所有检查
|
|
131
|
+
npm run lint
|
|
132
|
+
|
|
133
|
+
# 仅运行 ESLint
|
|
134
|
+
npm run lint:eslint
|
|
135
|
+
|
|
136
|
+
# 仅运行 Oxlint
|
|
137
|
+
npm run lint:oxlint
|
|
138
|
+
|
|
139
|
+
# 格式化代码
|
|
140
|
+
npm run format
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 类型检查
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npm run type-check
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 文档开发
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# 启动文档开发服务器
|
|
153
|
+
npm run docs:dev
|
|
154
|
+
|
|
155
|
+
# 构建文档
|
|
156
|
+
npm run docs:build
|
|
157
|
+
|
|
158
|
+
# 预览构建后的文档
|
|
159
|
+
npm run docs:preview
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## 项目结构
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
gy-ui-plus/
|
|
166
|
+
├── packages/ # 组件源码目录
|
|
167
|
+
│ ├── index.ts # 组件库入口文件
|
|
168
|
+
│ ├── withInstall.ts # 组件安装工具函数
|
|
169
|
+
│ ├── button/ # 按钮组件
|
|
170
|
+
│ │ ├── src/
|
|
171
|
+
│ │ │ ├── index.vue # 组件实现
|
|
172
|
+
│ │ │ └── type.ts # 类型定义
|
|
173
|
+
│ │ └── index.ts # 组件导出
|
|
174
|
+
│ ├── table/ # 增强表格组件
|
|
175
|
+
│ │ ├── src/
|
|
176
|
+
│ │ │ ├── index.vue # 主组件
|
|
177
|
+
│ │ │ ├── ColumnSet.vue # 列设置组件
|
|
178
|
+
│ │ │ ├── GyTableColumn.vue # 表格列组件
|
|
179
|
+
│ │ │ ├── operator.vue # 操作列组件
|
|
180
|
+
│ │ │ ├── renderCol.vue # 列渲染组件
|
|
181
|
+
│ │ │ ├── renderHeader.vue # 表头渲染组件
|
|
182
|
+
│ │ │ ├── singleEdit.vue # 单行编辑组件
|
|
183
|
+
│ │ │ ├── singleEditCell.vue # 单元格编辑组件
|
|
184
|
+
│ │ │ ├── tableProps.ts # 表格属性类型定义
|
|
185
|
+
│ │ │ ├── useExpose.ts # 组件暴露方法
|
|
186
|
+
│ │ │ └── useVirtualized.ts # 虚拟滚动逻辑
|
|
187
|
+
│ │ ├── style/
|
|
188
|
+
│ │ │ ├── index.ts # 样式导出
|
|
189
|
+
│ │ │ └── table.scss # 表格样式
|
|
190
|
+
│ │ └── index.ts # 组件导出
|
|
191
|
+
│ └── layout-page/ # 布局页面组件
|
|
192
|
+
│ ├── src/
|
|
193
|
+
│ │ └── index.vue # 组件实现
|
|
194
|
+
│ ├── style/
|
|
195
|
+
│ │ ├── index.ts # 样式导出
|
|
196
|
+
│ │ └── layout-page.scss # 布局样式
|
|
197
|
+
│ └── index.ts # 组件导出
|
|
198
|
+
├── typings/ # 全局类型定义
|
|
199
|
+
│ ├── env.d.ts # 环境变量类型
|
|
200
|
+
│ └── index.d.ts # 主类型定义
|
|
201
|
+
├── public/ # 静态资源目录
|
|
202
|
+
├── .editorconfig # 编辑器配置
|
|
203
|
+
├── .gitattributes # Git 属性配置
|
|
204
|
+
├── .gitignore # Git 忽略文件
|
|
205
|
+
├── .prettierignore # Prettier 忽略文件
|
|
206
|
+
├── .prettierrc.json # Prettier 配置
|
|
207
|
+
├── deploy.yml # 部署配置文件
|
|
208
|
+
├── eslint.config.ts # ESLint 配置
|
|
209
|
+
├── index.html # HTML 入口文件
|
|
210
|
+
├── package.json # 项目配置和依赖
|
|
211
|
+
├── README.md # 项目说明文档
|
|
212
|
+
├── tsconfig.app.json # 应用 TypeScript 配置
|
|
213
|
+
├── tsconfig.json # 主 TypeScript 配置
|
|
214
|
+
├── tsconfig.node.json # Node.js TypeScript 配置
|
|
215
|
+
└── vite.config.ts # Vite 构建配置
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## 技术栈
|
|
219
|
+
|
|
220
|
+
- **框架**: Vue 3
|
|
221
|
+
- **UI 基础**: Element Plus
|
|
222
|
+
- **构建工具**: Vite
|
|
223
|
+
- **语言**: TypeScript
|
|
224
|
+
- **样式**: SCSS
|
|
225
|
+
- **代码规范**: ESLint + Prettier + Oxlint
|
|
226
|
+
|
|
227
|
+
## 许可证
|
|
228
|
+
|
|
229
|
+
MIT License
|
|
230
|
+
|
|
231
|
+
## 贡献
|
|
232
|
+
|
|
233
|
+
欢迎提交 Issue 和 Pull Request 来帮助改进这个项目!
|
|
234
|
+
|
|
235
|
+
## 联系方式
|
|
236
|
+
|
|
237
|
+
- GitHub Issues: https://github.com/SKYE-iiii/gy-ui-plus/issues
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
感谢使用 gy-ui-plus!
|
package/deploy.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Deploy VitePress to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main] # 主分支名称
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
deploy:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v3
|
|
12
|
+
with:
|
|
13
|
+
fetch-depth: 0
|
|
14
|
+
|
|
15
|
+
- name: Setup Node.js
|
|
16
|
+
uses: actions/setup-node@v3
|
|
17
|
+
with:
|
|
18
|
+
node-version: 20
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm install
|
|
22
|
+
|
|
23
|
+
- name: Build docs
|
|
24
|
+
run: npm run docs:build
|
|
25
|
+
|
|
26
|
+
- name: Deploy to GitHub Pages
|
|
27
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
28
|
+
with:
|
|
29
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
+
publish_dir: ./docs/.vitepress/dist
|