morghulis 1.0.11 → 1.0.13

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/README.md CHANGED
@@ -1,33 +1,124 @@
1
- # morghulis
1
+ # Morghulis UI 组件库
2
2
 
3
- This template should help get you started developing with Vue 3 in Vite.
3
+ 基于Vue 3和TypeScript的数据库便捷搭建UI组件库,集成了Element Plus和FontAwesome图标,提供丰富的数据库操作界面组件。
4
4
 
5
- ## Recommended IDE Setup
5
+ ## 特性
6
6
 
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
7
+ - 基于Vue 3和TypeScript开发
8
+ - 自动集成Element Plus,无需额外安装
9
+ - 集成FontAwesome图标
10
+ - 提供高度可定制的对话框组件,适用于数据库操作交互
11
+ - 简化数据库表单创建和管理流程
12
+ - 内置常用数据库操作UI模板
8
13
 
9
- ## Type Support for `.vue` Imports in TS
14
+ ## 安装
10
15
 
11
- TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
16
+ ```bash
17
+ npm install morghulis
18
+ ```
19
+
20
+
21
+
22
+ ```bash
23
+ yarn add morghulis
24
+ ```
25
+
26
+ ## 快速开始
12
27
 
13
- ## Customize configuration
28
+ 在你的Vue 3项目中引入并使用组件库:
14
29
 
15
- See [Vite Configuration Reference](https://vite.dev/config/).
30
+ ```js
31
+ // main.ts 或 main.js
32
+ import { createApp } from 'vue'
33
+ import App from './App.vue'
34
+ import { createMorghulis } from 'morghulis'
16
35
 
17
- ## Project Setup
36
+ const app = createApp(App)
18
37
 
19
- ```sh
20
- npm install
38
+ // 使用Morghulis UI,自动集成Element Plus
39
+ app.use(createMorghulis())
40
+
41
+ app.mount('#app')
21
42
  ```
22
43
 
23
- ### Compile and Hot-Reload for Development
44
+ ## 组件
45
+
46
+ ### MDialog 对话框组件
47
+
48
+ 一个基于Element Plus Dialog的增强对话框组件,专为数据库操作设计,提供表单验证、数据预览和批量操作等功能,让数据库操作更加直观和高效。
49
+
50
+ #### 基本用法
51
+
52
+ ```vue
53
+ <template>
54
+ <div>
55
+ <el-button @click="dialogVisible = true">打开对话框</el-button>
56
+
57
+ <MDialog
58
+ v-model="dialogVisible"
59
+ title="对话框标题"
60
+ sub-title="副标题"
61
+ :confirm="handleConfirm"
62
+ >
63
+ <p>这是对话框的内容</p>
64
+ </MDialog>
65
+ </div>
66
+ </template>
24
67
 
25
- ```sh
26
- npm run dev
68
+ <script setup>
69
+ import { ref } from 'vue'
70
+
71
+ const dialogVisible = ref(false)
72
+
73
+ const handleConfirm = () => {
74
+ // 处理确认逻辑
75
+ console.log('确认')
76
+ dialogVisible.value = false
77
+ return Promise.resolve()
78
+ }
79
+ </script>
27
80
  ```
28
81
 
29
- ### Type-Check, Compile and Minify for Production
82
+ #### 属性
83
+
84
+ | 属性名 | 类型 | 默认值 | 说明 |
85
+ | --- | --- | --- | --- |
86
+ | modelValue / v-model | boolean | false | 控制对话框是否显示 |
87
+ | title | string | '对话框' | 对话框标题 |
88
+ | subTitle | string | - | 对话框副标题 |
89
+ | width | string / number | 600 | 对话框宽度 |
90
+ | fullscreen | boolean | false | 是否全屏显示 |
91
+ | confirm | Function | - | 确认按钮点击时的回调函数,返回Promise |
92
+ | cancel | Function | - | 取消按钮点击时的回调函数 |
93
+ | confirmButtonText | string | '确定' | 确认按钮文本 |
94
+ | cancelButtonText | string | '取消' | 取消按钮文本 |
95
+
96
+ 组件还支持Element Plus Dialog的所有属性。
97
+
98
+ #### 插槽
30
99
 
31
- ```sh
32
- npm run build
100
+ | 插槽名 | 说明 |
101
+ | --- | --- |
102
+ | default | 对话框内容 |
103
+ | title | 自定义标题区域 |
104
+ | sub-title | 自定义副标题区域 |
105
+ | header | 自定义头部区域 |
106
+ | footer | 自定义底部区域 |
107
+
108
+ ## 配置选项
109
+
110
+ 创建Morghulis实例时可以传入配置选项:
111
+
112
+ ```js
113
+ app.use(createMorghulis({
114
+ baseUrl: 'https://api.example.com',
115
+ timeout: 5000,
116
+ headers: {
117
+ 'X-Custom-Header': 'value'
118
+ }
119
+ }))
33
120
  ```
121
+
122
+ ## 许可证
123
+
124
+ MIT