@mingto/mt-ui 1.1.47 → 1.1.48

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,173 +1,209 @@
1
- # @mingto/mt-ui
2
-
3
- 基于 Vue 3 的企业级 UI 组件库,提供丰富的业务组件,帮助快速构建现代化应用界面。
4
-
5
- ## 特性
6
-
7
- - 🎨 **设计优雅**:简洁现代的视觉风格
8
- - 📦 **开箱即用**:无需复杂配置,直接引入使用
9
- - 🔧 **按需加载**:支持组件按需引入,优化打包体积
10
- - 🎯 **类型安全**:完整的 TypeScript 类型定义
11
- - 🌏 **国际化**:内置多语言支持
12
-
13
- ## 安装
14
-
15
- ```bash
16
- pnpm add @mingto/mt-ui
17
- ```
18
-
19
- ## 快速开始
20
-
21
- ### 全量引入
22
-
23
- ```typescript
24
- import MtUi from '@mingto/mt-ui'
25
- import { createApp } from 'vue'
26
- import App from './App.vue'
27
- import '@mingto/mt-ui/dist/style.css'
28
-
29
- const app = createApp(App)
30
- app.use(MtUi)
31
- app.mount('#app')
32
- ```
33
-
34
- ### 按需引入
35
-
36
- ```typescript
37
- import { MtButton, MtDialog, MtMessage } from '@mingto/mt-ui'
38
- import { createApp } from 'vue'
39
- import App from './App.vue'
40
- import '@mingto/mt-ui/dist/style.css'
41
-
42
- const app = createApp(App)
43
- app.use(MtButton)
44
- app.use(MtDialog)
45
- app.use(MtMessage)
46
- app.mount('#app')
47
- ```
48
-
49
- ## 基础组件
50
-
51
- | 组件 | 说明 |
52
- | --------- | -------- |
53
- | MtButton | 按钮 |
54
- | MtIcon | 图标 |
55
- | MtImage | 图片 |
56
- | MtLoading | 加载 |
57
- | MtBadge | 徽标 |
58
- | MtBacktop | 回到顶部 |
59
-
60
- ## 表单组件
61
-
62
- | 组件 | 说明 |
63
- | ---------- | -------- |
64
- | MtUpload | 文件上传 |
65
- | MtProgress | 进度条 |
66
-
67
- ## 展示组件
68
-
69
- | 组件 | 说明 |
70
- | ------------- | -------- |
71
- | MtAvatarImage | 图片头像 |
72
- | MtAvatarText | 文字头像 |
73
- | MtEmpty | 空状态 |
74
- | MtTag | 标签 |
75
- | MtQrcode | 二维码 |
76
- | MtTable | 表格 |
77
- | MtTableColumn | 表格列 |
78
- | MtPopover | 气泡卡片 |
79
- | MtTooltip | 文字提示 |
80
- | MtFilePreview | 文件预览 |
81
-
82
- ## 导航组件
83
-
84
- | 组件 | 说明 |
85
- | ---------------- | -------- |
86
- | MtTabs | 标签页 |
87
- | MtTab | 标签 |
88
- | MtInfiniteScroll | 无限滚动 |
89
-
90
- ## 反馈组件
91
-
92
- | 组件 | 说明 |
93
- | --------- | -------- |
94
- | MtDialog | 对话框 |
95
- | MtMessage | 消息提示 |
96
- | MtOverlay | 遮罩层 |
97
- | MtPoster | 海报 |
98
-
99
- ## 布局组件
100
-
101
- | 组件 | 说明 |
102
- | -------------------- | ------------ |
103
- | MtCell | 单元格 |
104
- | MtCellGroup | 单元格组 |
105
- | MtButtonGroup | 按钮组 |
106
- | MtCollapseTransition | 折叠过渡 |
107
- | MtFadeTransition | 淡入淡出过渡 |
108
- | MtTeleport | 传送门 |
109
- | MtConfigProvider | 全局配置 |
110
-
111
- ## 使用示例
112
-
113
- ### 按钮
114
-
115
- ```vue
116
- <mt-button type="primary">
117
- 主要按钮
118
- </mt-button>
119
-
120
- <mt-button type="success">
121
- 成功按钮
122
- </mt-button>
123
-
124
- <mt-button type="danger">
125
- 危险按钮
126
- </mt-button>
127
- ```
128
-
129
- ### 对话框
130
-
131
- ```vue
132
- <mt-dialog v-model="visible" title="标题">
133
- <p>对话框内容</p>
134
- <template #footer>
135
- <mt-button @click="visible = false">取消</mt-button>
136
- <mt-button type="primary" @click="visible = false">确定</mt-button>
137
- </template>
138
- </mt-dialog>
139
- ```
140
-
141
- ### 消息提示
142
-
143
- ```typescript
144
- import { MtMessage } from '@mingto/mt-ui'
145
-
146
- MtMessage.success('操作成功')
147
- MtMessage.error('操作失败')
148
- MtMessage.warning('警告提示')
149
- ```
150
-
151
- ### 文件上传
152
-
153
- ```vue
154
- <mt-upload v-model="fileList" :limit="9">
155
- <mt-button type="primary">点击上传</mt-button>
156
- </mt-upload>
157
- ```
158
-
159
- ## 全局配置
160
-
161
- ```vue
162
- <mt-config-provider :locale="{ lang: 'en' }">
163
- <app />
164
- </mt-config-provider>
165
- ```
166
-
167
- ## 完整文档
168
-
169
- 更多组件和详细用法请参考 [官方文档](https://mingto.github.io/mt-utils/ui/)
170
-
171
- ## 许可证
172
-
173
- MIT
1
+ # @mingto/mt-ui
2
+
3
+ 基于 Vue 3 UI 组件库,提供业务常用组件、布局组件、反馈组件、上传组件、国际化和工具 Hook。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pnpm add @mingto/mt-ui
9
+ ```
10
+
11
+ 需要项目中已安装 Vue 3,当前 peer dependency 为 `vue@^3.5.13`。
12
+
13
+ ## 快速开始
14
+
15
+ ### 全量引入
16
+
17
+ ```typescript
18
+ import MtUi from '@mingto/mt-ui'
19
+ import { createApp } from 'vue'
20
+ import App from './App.vue'
21
+
22
+ const app = createApp(App)
23
+
24
+ app.use(MtUi)
25
+ app.mount('#app')
26
+ ```
27
+
28
+ ### 按需引入
29
+
30
+ ```typescript
31
+ import { MtButton, MtDialog, MtMessage } from '@mingto/mt-ui'
32
+ import { createApp } from 'vue'
33
+ import App from './App.vue'
34
+
35
+ const app = createApp(App)
36
+
37
+ app.use(MtButton)
38
+ app.use(MtDialog)
39
+ app.use(MtMessage)
40
+ app.mount('#app')
41
+ ```
42
+
43
+ ### 在 setup 中使用
44
+
45
+ ```vue
46
+ <script setup lang="ts">
47
+ import { MtMessage } from '@mingto/mt-ui'
48
+
49
+ function submit() {
50
+ MtMessage.success('操作成功')
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <MtButton type="primary" @click="submit">
56
+ 提交
57
+ </MtButton>
58
+ </template>
59
+ ```
60
+
61
+ ## 组件列表
62
+
63
+ ### 基础组件
64
+
65
+ | 组件 | 说明 |
66
+ |------|------|
67
+ | `MtButton` | 按钮 |
68
+ | `MtButtonGroup` | 按钮组 |
69
+ | `MtIcon` | 图标 |
70
+ | `MtImage` | 图片 |
71
+ | `MtLoading` | 加载 |
72
+ | `MtBadge` | 徽标 |
73
+ | `MtBacktop` | 回到顶部 |
74
+
75
+ ### 展示组件
76
+
77
+ | 组件 | 说明 |
78
+ |------|------|
79
+ | `MtAvatarImage` | 图片头像 |
80
+ | `MtAvatarText` | 文字头像 |
81
+ | `MtEmpty` | 空状态 |
82
+ | `MtFilePreview` | 文件预览 |
83
+ | `MtPopover` | 气泡卡片 |
84
+ | `MtProgress` | 进度条 |
85
+ | `MtQrcode` | 二维码 |
86
+ | `MtTable` | 表格 |
87
+ | `MtTableColumn` | 表格列 |
88
+ | `MtTag` | 标签 |
89
+ | `MtTooltip` | 文字提示 |
90
+
91
+ ### 导航组件
92
+
93
+ | 组件 | 说明 |
94
+ |------|------|
95
+ | `MtTabs` | 标签页容器 |
96
+ | `MtTab` | 标签页项 |
97
+ | `MtInfiniteScroll` | 无限滚动 |
98
+
99
+ ### 反馈组件
100
+
101
+ | 组件 | 说明 |
102
+ |------|------|
103
+ | `MtDialog` | 对话框 |
104
+ | `MtDialogConfirmLayout` | 对话框确认布局 |
105
+ | `MtMessage` | 消息提示 |
106
+ | `MtOverlay` | 遮罩层 |
107
+ | `MtPoster` | 海报 |
108
+
109
+ ### 布局与过渡组件
110
+
111
+ | 组件 | 说明 |
112
+ |------|------|
113
+ | `MtCell` | 单元格 |
114
+ | `MtCellGroup` | 单元格组 |
115
+ | `MtCollapseTransition` | 折叠过渡 |
116
+ | `MtFadeTransition` | 淡入淡出过渡 |
117
+ | `MtTeleport` | 传送门 |
118
+ | `MtConfigProvider` | 全局配置 |
119
+
120
+ ### 上传组件
121
+
122
+ | 组件或方法 | 说明 |
123
+ |------------|------|
124
+ | `MtUpload` | 上传组件 |
125
+ | `MtUploadFileListLayout` | 上传文件列表布局 |
126
+ | `MtUploadImageGridLayout` | 上传图片宫格布局 |
127
+ | `MtUploadImageOnlyLayout` | 仅图片上传布局 |
128
+ | `formatUploadFiles` | 格式化上传文件数据 |
129
+
130
+ ## 常用示例
131
+
132
+ ### 按钮
133
+
134
+ ```vue
135
+ <template>
136
+ <MtButton type="primary">
137
+ 主要按钮
138
+ </MtButton>
139
+ <MtButton type="success">
140
+ 成功按钮
141
+ </MtButton>
142
+ <MtButton type="danger">
143
+ 危险按钮
144
+ </MtButton>
145
+ </template>
146
+ ```
147
+
148
+ ### 对话框
149
+
150
+ ```vue
151
+ <template>
152
+ <MtDialog v-model="visible" title="标题">
153
+ <p>对话框内容</p>
154
+ <template #footer>
155
+ <MtButton @click="visible = false">
156
+ 取消
157
+ </MtButton>
158
+ <MtButton type="primary" @click="visible = false">
159
+ 确定
160
+ </MtButton>
161
+ </template>
162
+ </MtDialog>
163
+ </template>
164
+ ```
165
+
166
+ ### 消息提示
167
+
168
+ ```typescript
169
+ import { MtMessage } from '@mingto/mt-ui'
170
+
171
+ MtMessage.success('操作成功')
172
+ MtMessage.warning('警告提示')
173
+ MtMessage.error('操作失败')
174
+ ```
175
+
176
+ ### 上传
177
+
178
+ ```vue
179
+ <template>
180
+ <MtUpload v-model="fileList" :limit="9">
181
+ <MtButton type="primary">
182
+ 点击上传
183
+ </MtButton>
184
+ </MtUpload>
185
+ </template>
186
+ ```
187
+
188
+ ### 全局配置
189
+
190
+ ```vue
191
+ <template>
192
+ <MtConfigProvider :locale="{ lang: 'en' }">
193
+ <App />
194
+ </MtConfigProvider>
195
+ </template>
196
+ ```
197
+
198
+ ## 其它导出
199
+
200
+ ```typescript
201
+ import { iconfontJson } from '@mingto/mt-ui'
202
+ import { useLocale } from '@mingto/mt-ui'
203
+ ```
204
+
205
+ 包内同时导出 `hooks` 与 `locale` 模块,可按需从主入口导入使用。
206
+
207
+ ## 许可证
208
+
209
+ ISC