fantasia-ui 0.3.3 → 0.4.0
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.en.md +342 -8
- package/README.md +342 -8
- package/dist/fantasia-ui.css +1682 -445
- package/dist/fantasia-ui.es.js +1411 -699
- package/dist/fantasia-ui.umd.js +1409 -697
- package/dist/types/packages/components/index.d.ts +4 -0
- package/dist/types/packages/components/modules/FCollapse.vue.d.ts +7 -2
- package/dist/types/packages/components/modules/FDatePicker.vue.d.ts +16 -0
- package/dist/types/packages/components/modules/FDialog.vue.d.ts +3 -3
- package/dist/types/packages/components/modules/FDrawer.vue.d.ts +3 -3
- package/dist/types/packages/components/modules/FDropdown.vue.d.ts +15 -8
- package/dist/types/packages/components/modules/FSelect.vue.d.ts +16 -7
- package/dist/types/packages/components/modules/FSteps.vue.d.ts +1 -1
- package/dist/types/packages/components/modules/FTextarea.vue.d.ts +16 -0
- package/dist/types/packages/components/modules/FTimeline.vue.d.ts +16 -0
- package/dist/types/packages/components/modules/FTimelineItem.vue.d.ts +22 -0
- package/dist/types/packages/types/components/index.d.ts +3 -0
- package/dist/types/packages/types/components/modules/f-accordion.d.ts +34 -0
- package/dist/types/packages/types/components/modules/f-avatar.d.ts +5 -0
- package/dist/types/packages/types/components/modules/f-badge.d.ts +6 -0
- package/dist/types/packages/types/components/modules/f-button.d.ts +14 -0
- package/dist/types/packages/types/components/modules/f-card.d.ts +2 -0
- package/dist/types/packages/types/components/modules/f-checkbox.d.ts +2 -0
- package/dist/types/packages/types/components/modules/f-collapse.d.ts +6 -0
- package/dist/types/packages/types/components/modules/f-date-picker.d.ts +11 -0
- package/dist/types/packages/types/components/modules/f-dropdown.d.ts +17 -0
- package/dist/types/packages/types/components/modules/f-input-number.d.ts +7 -2
- package/dist/types/packages/types/components/modules/f-input.d.ts +4 -0
- package/dist/types/packages/types/components/modules/f-radio.d.ts +4 -0
- package/dist/types/packages/types/components/modules/f-scrollbar.d.ts +6 -5
- package/dist/types/packages/types/components/modules/f-select.d.ts +12 -0
- package/dist/types/packages/types/components/modules/f-switch.d.ts +4 -0
- package/dist/types/packages/types/components/modules/f-tag.d.ts +5 -0
- package/dist/types/packages/types/components/modules/f-textarea.d.ts +19 -0
- package/dist/types/packages/types/components/modules/f-timeline.d.ts +26 -0
- package/package.json +4 -10
package/README.en.md
CHANGED
|
@@ -1,10 +1,344 @@
|
|
|
1
1
|
# Fantasia UI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
A modern UI component library based on Vue 3 + TypeScript with 60+ high-quality components
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/fantasia-ui)
|
|
10
|
+
[](https://www.npmjs.com/package/fantasia-ui)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://vuejs.org/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## ✨ Features
|
|
17
|
+
|
|
18
|
+
- **Modern Design** - Clean and elegant design language, supports dark/light themes
|
|
19
|
+
- **Full TypeScript Support** - Complete type definitions and intelligent code completion
|
|
20
|
+
- **High Performance** - Built with Vue 3 Composition API, components are loaded on demand
|
|
21
|
+
- **Responsive Design** - Perfectly adapts to desktop and mobile devices
|
|
22
|
+
- **Customizable** - Supports theme customization and component style overrides
|
|
23
|
+
- **Rich Component Library** - 60+ high-quality Vue 3 components
|
|
24
|
+
- **Comprehensive Documentation** - Detailed API documentation and usage examples
|
|
25
|
+
- **Active Maintenance** - Continuous updates and timely issue fixes
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
### NPM
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install fantasia-ui
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Yarn
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yarn add fantasia-ui
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### PNPM
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm add fantasia-ui
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 🚀 Quick Start
|
|
48
|
+
|
|
49
|
+
### Full Import
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// main.ts
|
|
53
|
+
import { createApp } from 'vue'
|
|
54
|
+
import FantasiaUI from 'fantasia-ui'
|
|
55
|
+
import 'fantasia-ui/dist/fantasia-ui.css'
|
|
56
|
+
|
|
57
|
+
const app = createApp(App)
|
|
58
|
+
app.use(FantasiaUI)
|
|
59
|
+
app.mount('#app')
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### On-demand Import
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// In your Vue component
|
|
66
|
+
import { FButton, FInput, FSelect } from 'fantasia-ui'
|
|
67
|
+
import 'fantasia-ui/dist/fantasia-ui.css'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
components: {
|
|
71
|
+
FButton,
|
|
72
|
+
FInput,
|
|
73
|
+
FSelect
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Vite Project Configuration
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
// vite.config.js
|
|
82
|
+
import { defineConfig } from 'vite'
|
|
83
|
+
import vue from '@vitejs/plugin-vue'
|
|
84
|
+
|
|
85
|
+
export default defineConfig({
|
|
86
|
+
plugins: [vue()]
|
|
87
|
+
})
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 📚 Component List
|
|
91
|
+
|
|
92
|
+
### Basic Components
|
|
93
|
+
- **FButton** - Button
|
|
94
|
+
- **FInput** - Input
|
|
95
|
+
- **FSelect** - Select (supports adding new options)
|
|
96
|
+
- **FCheckbox** - Checkbox
|
|
97
|
+
- **FRadio** - Radio
|
|
98
|
+
- **FSlider** - Slider
|
|
99
|
+
- **FInputNumber** - Number Input
|
|
100
|
+
- **FColorPicker** - Color Picker
|
|
101
|
+
- **FDatePicker** - Date Picker
|
|
102
|
+
- **FTimePicker** - Time Picker
|
|
103
|
+
|
|
104
|
+
### Layout Components
|
|
105
|
+
- **FContainer** - Container
|
|
106
|
+
- **FGrid** - Grid Layout
|
|
107
|
+
- **FRow** / **FCol** - Row/Column
|
|
108
|
+
- **FDivider** - Divider
|
|
109
|
+
- **FSpace** - Space
|
|
110
|
+
- **FScrollbar** - Scrollbar
|
|
111
|
+
|
|
112
|
+
### Data Display
|
|
113
|
+
- **FCard** - Card
|
|
114
|
+
- **FTag** - Tag
|
|
115
|
+
- **FBadge** - Badge
|
|
116
|
+
- **FTable** - Table
|
|
117
|
+
- **FTimeline** - Timeline
|
|
118
|
+
- **FEmpty** - Empty State
|
|
119
|
+
- **FResult** - Result Page
|
|
120
|
+
- **FImage** - Image
|
|
121
|
+
- **FAvatar** - Avatar
|
|
122
|
+
- **FList** - List
|
|
123
|
+
|
|
124
|
+
### Feedback Components
|
|
125
|
+
- **FDialog** - Dialog
|
|
126
|
+
- **FDrawer** - Drawer
|
|
127
|
+
- **FMessage** - Message
|
|
128
|
+
- **FNotification** - Notification
|
|
129
|
+
- **FLoading** - Loading
|
|
130
|
+
- **FAlert** - Alert
|
|
131
|
+
- **FPopover** - Popover
|
|
132
|
+
- **FTooltip** - Tooltip
|
|
133
|
+
- **FPopconfirm** - Popconfirm
|
|
134
|
+
|
|
135
|
+
### Navigation Components
|
|
136
|
+
- **FDropdown** - Dropdown
|
|
137
|
+
- **FTabs** - Tabs
|
|
138
|
+
- **FBreadcrumb** - Breadcrumb
|
|
139
|
+
- **FMenu** - Menu
|
|
140
|
+
- **FAffix** - Affix
|
|
141
|
+
- **FPagination** - Pagination
|
|
142
|
+
- **FSteps** - Steps
|
|
143
|
+
|
|
144
|
+
### Other Components
|
|
145
|
+
- **FUpload** - Upload
|
|
146
|
+
- **FIcon** - Icon
|
|
147
|
+
- **FCollapse** - Collapse (supports adding new panels)
|
|
148
|
+
- **FCarousel** - Carousel
|
|
149
|
+
- **FEditor** - Rich Text Editor
|
|
150
|
+
- **FMask** - Mask
|
|
151
|
+
- **FSliderCaptcha** - Slider Captcha
|
|
152
|
+
- **FCrop** - Image Crop
|
|
153
|
+
|
|
154
|
+
## 🔧 New Feature Highlights
|
|
155
|
+
|
|
156
|
+
### FSelect Add Option Feature
|
|
157
|
+
|
|
158
|
+
Fantasia UI's FSelect component supports two modes for adding new options:
|
|
159
|
+
|
|
160
|
+
#### 1. Create on Input (allowCreate)
|
|
161
|
+
|
|
162
|
+
```vue
|
|
163
|
+
<template>
|
|
164
|
+
<FSelect
|
|
165
|
+
:options="options"
|
|
166
|
+
filterable
|
|
167
|
+
allow-create
|
|
168
|
+
placeholder="Type and press Enter to add new option"
|
|
169
|
+
@add="handleAddOption"
|
|
170
|
+
/>
|
|
171
|
+
</template>
|
|
172
|
+
|
|
173
|
+
<script setup>
|
|
174
|
+
const options = ref([
|
|
175
|
+
{ key: '1', label: 'Option 1' },
|
|
176
|
+
{ key: '2', label: 'Option 2' }
|
|
177
|
+
])
|
|
178
|
+
|
|
179
|
+
function handleAddOption(label) {
|
|
180
|
+
const newKey = `new_${Date.now()}`
|
|
181
|
+
const newOption = { key: newKey, label }
|
|
182
|
+
options.value.push(newOption)
|
|
183
|
+
}
|
|
184
|
+
</script>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### 2. Add Button Mode (showAddOption)
|
|
188
|
+
|
|
189
|
+
```vue
|
|
190
|
+
<template>
|
|
191
|
+
<FSelect
|
|
192
|
+
:options="options"
|
|
193
|
+
show-add-option
|
|
194
|
+
add-option-text="Add New Option"
|
|
195
|
+
@add="handleAddOption"
|
|
196
|
+
/>
|
|
197
|
+
</template>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### FCollapse Add Panel Feature
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<template>
|
|
204
|
+
<FCollapse
|
|
205
|
+
show-add-button
|
|
206
|
+
add-button-position="bottom"
|
|
207
|
+
add-button-text="Add New Panel"
|
|
208
|
+
@add="handleAddPanel"
|
|
209
|
+
>
|
|
210
|
+
<FCollapseItem name="1" title="Panel 1">
|
|
211
|
+
Content 1
|
|
212
|
+
</FCollapseItem>
|
|
213
|
+
</FCollapse>
|
|
214
|
+
</template>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## 🎨 Theme Customization
|
|
218
|
+
|
|
219
|
+
### Using CSS Variables
|
|
220
|
+
|
|
221
|
+
```css
|
|
222
|
+
/* In your style file */
|
|
223
|
+
:root {
|
|
224
|
+
--fantasia-primary-color: #ec4899;
|
|
225
|
+
--fantasia-border-radius: 8px;
|
|
226
|
+
--fantasia-font-size: 14px;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Using SCSS Variables
|
|
231
|
+
|
|
232
|
+
```scss
|
|
233
|
+
// Override SCSS variables
|
|
234
|
+
$primary-color: #ec4899;
|
|
235
|
+
$border-radius: 8px;
|
|
236
|
+
|
|
237
|
+
@import 'fantasia-ui/dist/style.css';
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 📖 API Documentation
|
|
241
|
+
|
|
242
|
+
Each component includes detailed API documentation:
|
|
243
|
+
- **Props** - Component properties
|
|
244
|
+
- **Events** - Component events
|
|
245
|
+
- **Slots** - Slot usage
|
|
246
|
+
- **Methods** - Component methods
|
|
247
|
+
- **Types** - TypeScript type definitions
|
|
248
|
+
|
|
249
|
+
## 🛠️ Development Guide
|
|
250
|
+
|
|
251
|
+
### Environment Requirements
|
|
252
|
+
|
|
253
|
+
- Node.js >= 16.0.0
|
|
254
|
+
- Vue >= 3.3.0
|
|
255
|
+
- TypeScript >= 5.0.0
|
|
256
|
+
|
|
257
|
+
### Development Commands
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Clone the repository
|
|
261
|
+
git clone https://github.com/ShusterLi/fantasia-ui.git
|
|
262
|
+
cd fantasia-ui
|
|
263
|
+
|
|
264
|
+
# Install dependencies
|
|
265
|
+
pnpm install
|
|
266
|
+
|
|
267
|
+
# Start development server
|
|
268
|
+
pnpm run dev
|
|
269
|
+
|
|
270
|
+
# Build for production
|
|
271
|
+
pnpm run build
|
|
272
|
+
|
|
273
|
+
# Preview build result
|
|
274
|
+
pnpm run preview
|
|
275
|
+
|
|
276
|
+
# Run tests
|
|
277
|
+
pnpm run test
|
|
278
|
+
|
|
279
|
+
# Format code
|
|
280
|
+
pnpm run lint
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Project Structure
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
fantasia-ui/
|
|
287
|
+
├── packages/
|
|
288
|
+
│ ├── components/ # Component source code
|
|
289
|
+
│ │ └── modules/ # Component modules
|
|
290
|
+
│ ├── styles/ # Style files
|
|
291
|
+
│ ├── types/ # TypeScript type definitions
|
|
292
|
+
│ ├── composables/ # Composable functions
|
|
293
|
+
│ └── utils/ # Utility functions
|
|
294
|
+
├── docs/ # Documentation
|
|
295
|
+
├── examples/ # Example code
|
|
296
|
+
├── tests/ # Test files
|
|
297
|
+
└── scripts/ # Build scripts
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## 🤝 Contributing
|
|
301
|
+
|
|
302
|
+
We welcome all forms of contributions! Please check our [Contributing Guide](docs/CONTRIBUTING.md).
|
|
303
|
+
|
|
304
|
+
### Development Workflow
|
|
305
|
+
|
|
306
|
+
1. Fork the project
|
|
307
|
+
2. Create feature branch (`git checkout -b feature/amazing-feature`)
|
|
308
|
+
3. Commit changes (`git commit -m 'Add some amazing feature'`)
|
|
309
|
+
4. Push to branch (`git push origin feature/amazing-feature`)
|
|
310
|
+
5. Create Pull Request
|
|
311
|
+
|
|
312
|
+
### Code Standards
|
|
313
|
+
|
|
314
|
+
- Write code in TypeScript
|
|
315
|
+
- Follow ESLint rules
|
|
316
|
+
- Write component unit tests
|
|
317
|
+
- Update relevant documentation
|
|
318
|
+
|
|
319
|
+
## 🐛 Issue Reporting
|
|
320
|
+
|
|
321
|
+
If you encounter any issues or have feature suggestions:
|
|
322
|
+
|
|
323
|
+
1. Check [existing issues](https://github.com/ShusterLi/fantasia-ui/issues)
|
|
324
|
+
2. If no related issue exists, create a new one
|
|
325
|
+
3. Provide detailed reproduction steps and environment information
|
|
326
|
+
|
|
327
|
+
## 📄 License
|
|
328
|
+
|
|
329
|
+
This project is open source under the [MIT License](LICENSE).
|
|
330
|
+
|
|
331
|
+
## 🙏 Acknowledgments
|
|
332
|
+
|
|
333
|
+
Thanks to all developers who have contributed to Fantasia UI!
|
|
334
|
+
|
|
335
|
+
## 📞 Contact
|
|
336
|
+
|
|
337
|
+
- GitHub: [@ShusterLi](https://github.com/ShusterLi)
|
|
338
|
+
- Email: [Contact via GitHub Issues](https://github.com/ShusterLi/fantasia-ui/issues)
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
<div align="center">
|
|
343
|
+
<sub>Built with ❤️ | Made with ❤️ by Shuster and Contributors</sub>
|
|
344
|
+
</div>
|
package/README.md
CHANGED
|
@@ -1,10 +1,344 @@
|
|
|
1
1
|
# Fantasia UI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
一个基于 Vue 3 + TypeScript 的现代化 UI 组件库,提供 60+ 个高质量组件
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/fantasia-ui)
|
|
10
|
+
[](https://www.npmjs.com/package/fantasia-ui)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://vuejs.org/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## ✨ 特性
|
|
17
|
+
|
|
18
|
+
- **现代化的设计** - 简洁优雅的设计语言,支持深色/浅色主题
|
|
19
|
+
- **完整的 TypeScript 支持** - 提供完整的类型定义和智能提示
|
|
20
|
+
- **高性能** - 基于 Vue 3 组合式 API,组件按需加载
|
|
21
|
+
- **响应式设计** - 完美适配桌面端和移动端
|
|
22
|
+
- **可定制性** - 支持主题定制、组件样式覆盖
|
|
23
|
+
- **丰富的组件库** - 60+ 个高质量的 Vue 3 组件
|
|
24
|
+
- **完善的文档** - 详细的 API 文档和使用示例
|
|
25
|
+
- **活跃的维护** - 持续更新,及时修复问题
|
|
26
|
+
|
|
27
|
+
## 📦 安装
|
|
28
|
+
|
|
29
|
+
### NPM 安装
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install fantasia-ui
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Yarn 安装
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yarn add fantasia-ui
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### PNPM 安装
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm add fantasia-ui
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 🚀 快速开始
|
|
48
|
+
|
|
49
|
+
### 完整导入
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// main.ts
|
|
53
|
+
import { createApp } from 'vue'
|
|
54
|
+
import FantasiaUI from 'fantasia-ui'
|
|
55
|
+
import 'fantasia-ui/dist/fantasia-ui.css'
|
|
56
|
+
|
|
57
|
+
const app = createApp(App)
|
|
58
|
+
app.use(FantasiaUI)
|
|
59
|
+
app.mount('#app')
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 按需导入
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// 在你的 Vue 组件中
|
|
66
|
+
import { FButton, FInput, FSelect } from 'fantasia-ui'
|
|
67
|
+
import 'fantasia-ui/dist/fantasia-ui.css'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
components: {
|
|
71
|
+
FButton,
|
|
72
|
+
FInput,
|
|
73
|
+
FSelect
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Vite 项目配置
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
// vite.config.js
|
|
82
|
+
import { defineConfig } from 'vite'
|
|
83
|
+
import vue from '@vitejs/plugin-vue'
|
|
84
|
+
|
|
85
|
+
export default defineConfig({
|
|
86
|
+
plugins: [vue()]
|
|
87
|
+
})
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 📚 组件列表
|
|
91
|
+
|
|
92
|
+
### 基础组件
|
|
93
|
+
- **FButton** - 按钮
|
|
94
|
+
- **FInput** - 输入框
|
|
95
|
+
- **FSelect** - 选择器(支持新增选项功能)
|
|
96
|
+
- **FCheckbox** - 复选框
|
|
97
|
+
- **FRadio** - 单选框
|
|
98
|
+
- **FSlider** - 滑动输入条
|
|
99
|
+
- **FInputNumber** - 数字输入框
|
|
100
|
+
- **FColorPicker** - 颜色选择器
|
|
101
|
+
- **FDatePicker** - 日期选择器
|
|
102
|
+
- **FTimePicker** - 时间选择器
|
|
103
|
+
|
|
104
|
+
### 布局组件
|
|
105
|
+
- **FContainer** - 布局容器
|
|
106
|
+
- **FGrid** - 栅格布局
|
|
107
|
+
- **FRow** / **FCol** - 行/列
|
|
108
|
+
- **FDivider** - 分割线
|
|
109
|
+
- **FSpace** - 间距
|
|
110
|
+
- **FScrollbar** - 滚动条
|
|
111
|
+
|
|
112
|
+
### 数据展示
|
|
113
|
+
- **FCard** - 卡片
|
|
114
|
+
- **FTag** - 标签
|
|
115
|
+
- **FBadge** - 徽章
|
|
116
|
+
- **FTable** - 表格
|
|
117
|
+
- **FTimeline** - 时间轴
|
|
118
|
+
- **FEmpty** - 空状态
|
|
119
|
+
- **FResult** - 结果页
|
|
120
|
+
- **FImage** - 图片
|
|
121
|
+
- **FAvatar** - 头像
|
|
122
|
+
- **FList** - 列表
|
|
123
|
+
|
|
124
|
+
### 反馈组件
|
|
125
|
+
- **FDialog** - 对话框
|
|
126
|
+
- **FDrawer** - 抽屉
|
|
127
|
+
- **FMessage** - 消息提示
|
|
128
|
+
- **FNotification** - 通知
|
|
129
|
+
- **FLoading** - 加载中
|
|
130
|
+
- **FAlert** - 警告提示
|
|
131
|
+
- **FPopover** - 气泡卡片
|
|
132
|
+
- **FTooltip** - 文字提示
|
|
133
|
+
- **FPopconfirm** - 气泡确认框
|
|
134
|
+
|
|
135
|
+
### 导航组件
|
|
136
|
+
- **FDropdown** - 下拉菜单
|
|
137
|
+
- **FTabs** - 标签页
|
|
138
|
+
- **FBreadcrumb** - 面包屑
|
|
139
|
+
- **FMenu** - 菜单
|
|
140
|
+
- **FAffix** - 固钉
|
|
141
|
+
- **FPagination** - 分页
|
|
142
|
+
- **FSteps** - 步骤条
|
|
143
|
+
|
|
144
|
+
### 其他组件
|
|
145
|
+
- **FUpload** - 文件上传
|
|
146
|
+
- **FIcon** - 图标
|
|
147
|
+
- **FCollapse** - 折叠面板(支持新增面板功能)
|
|
148
|
+
- **FCarousel** - 走马灯
|
|
149
|
+
- **FEditor** - 富文本编辑器
|
|
150
|
+
- **FMask** - 遮罩层
|
|
151
|
+
- **FSliderCaptcha** - 滑块验证码
|
|
152
|
+
- **FCrop** - 图片裁剪
|
|
153
|
+
|
|
154
|
+
## 🔧 新增功能亮点
|
|
155
|
+
|
|
156
|
+
### FSelect 新增选项功能
|
|
157
|
+
|
|
158
|
+
Fantasia UI 的 FSelect 组件支持两种新增选项模式:
|
|
159
|
+
|
|
160
|
+
#### 1. 输入时新增(allowCreate)
|
|
161
|
+
|
|
162
|
+
```vue
|
|
163
|
+
<template>
|
|
164
|
+
<FSelect
|
|
165
|
+
:options="options"
|
|
166
|
+
filterable
|
|
167
|
+
allow-create
|
|
168
|
+
placeholder="输入内容后按回车新增选项"
|
|
169
|
+
@add="handleAddOption"
|
|
170
|
+
/>
|
|
171
|
+
</template>
|
|
172
|
+
|
|
173
|
+
<script setup>
|
|
174
|
+
const options = ref([
|
|
175
|
+
{ key: '1', label: '选项1' },
|
|
176
|
+
{ key: '2', label: '选项2' }
|
|
177
|
+
])
|
|
178
|
+
|
|
179
|
+
function handleAddOption(label) {
|
|
180
|
+
const newKey = `new_${Date.now()}`
|
|
181
|
+
const newOption = { key: newKey, label }
|
|
182
|
+
options.value.push(newOption)
|
|
183
|
+
}
|
|
184
|
+
</script>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### 2. 新增按钮模式(showAddOption)
|
|
188
|
+
|
|
189
|
+
```vue
|
|
190
|
+
<template>
|
|
191
|
+
<FSelect
|
|
192
|
+
:options="options"
|
|
193
|
+
show-add-option
|
|
194
|
+
add-option-text="添加新选项"
|
|
195
|
+
@add="handleAddOption"
|
|
196
|
+
/>
|
|
197
|
+
</template>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### FCollapse 新增面板功能
|
|
201
|
+
|
|
202
|
+
```vue
|
|
203
|
+
<template>
|
|
204
|
+
<FCollapse
|
|
205
|
+
show-add-button
|
|
206
|
+
add-button-position="bottom"
|
|
207
|
+
add-button-text="添加新面板"
|
|
208
|
+
@add="handleAddPanel"
|
|
209
|
+
>
|
|
210
|
+
<FCollapseItem name="1" title="面板1">
|
|
211
|
+
内容1
|
|
212
|
+
</FCollapseItem>
|
|
213
|
+
</FCollapse>
|
|
214
|
+
</template>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## 🎨 主题定制
|
|
218
|
+
|
|
219
|
+
### 使用 CSS 变量
|
|
220
|
+
|
|
221
|
+
```css
|
|
222
|
+
/* 在你的样式文件中 */
|
|
223
|
+
:root {
|
|
224
|
+
--fantasia-primary-color: #ec4899;
|
|
225
|
+
--fantasia-border-radius: 8px;
|
|
226
|
+
--fantasia-font-size: 14px;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 使用 SCSS 变量
|
|
231
|
+
|
|
232
|
+
```scss
|
|
233
|
+
// 覆盖 SCSS 变量
|
|
234
|
+
$primary-color: #ec4899;
|
|
235
|
+
$border-radius: 8px;
|
|
236
|
+
|
|
237
|
+
@import 'fantasia-ui/dist/style.css';
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 📖 API 文档
|
|
241
|
+
|
|
242
|
+
每个组件都有详细的 API 文档,包括:
|
|
243
|
+
- **Props** - 组件属性配置
|
|
244
|
+
- **Events** - 组件事件
|
|
245
|
+
- **Slots** - 插槽用法
|
|
246
|
+
- **Methods** - 组件方法
|
|
247
|
+
- **Types** - TypeScript 类型定义
|
|
248
|
+
|
|
249
|
+
## 🛠️ 开发指南
|
|
250
|
+
|
|
251
|
+
### 环境要求
|
|
252
|
+
|
|
253
|
+
- Node.js >= 16.0.0
|
|
254
|
+
- Vue >= 3.3.0
|
|
255
|
+
- TypeScript >= 5.0.0
|
|
256
|
+
|
|
257
|
+
### 开发命令
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# 克隆项目
|
|
261
|
+
git clone https://github.com/ShusterLi/fantasia-ui.git
|
|
262
|
+
cd fantasia-ui
|
|
263
|
+
|
|
264
|
+
# 安装依赖
|
|
265
|
+
pnpm install
|
|
266
|
+
|
|
267
|
+
# 启动开发服务器
|
|
268
|
+
pnpm run dev
|
|
269
|
+
|
|
270
|
+
# 构建生产版本
|
|
271
|
+
pnpm run build
|
|
272
|
+
|
|
273
|
+
# 预览构建结果
|
|
274
|
+
pnpm run preview
|
|
275
|
+
|
|
276
|
+
# 运行测试
|
|
277
|
+
pnpm run test
|
|
278
|
+
|
|
279
|
+
# 格式化代码
|
|
280
|
+
pnpm run lint
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 项目结构
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
fantasia-ui/
|
|
287
|
+
├── packages/
|
|
288
|
+
│ ├── components/ # 组件源代码
|
|
289
|
+
│ │ └── modules/ # 组件模块
|
|
290
|
+
│ ├── styles/ # 样式文件
|
|
291
|
+
│ ├── types/ # TypeScript 类型定义
|
|
292
|
+
│ ├── composables/ # 组合式函数
|
|
293
|
+
│ └── utils/ # 工具函数
|
|
294
|
+
├── docs/ # 文档
|
|
295
|
+
├── examples/ # 示例代码
|
|
296
|
+
├── tests/ # 测试文件
|
|
297
|
+
└── scripts/ # 构建脚本
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## 🤝 贡献指南
|
|
301
|
+
|
|
302
|
+
我们欢迎所有形式的贡献!请查看我们的 [贡献指南](docs/CONTRIBUTING.md)。
|
|
303
|
+
|
|
304
|
+
### 开发流程
|
|
305
|
+
|
|
306
|
+
1. Fork 项目
|
|
307
|
+
2. 创建特性分支 (`git checkout -b feature/amazing-feature`)
|
|
308
|
+
3. 提交更改 (`git commit -m 'Add some amazing feature'`)
|
|
309
|
+
4. 推送到分支 (`git push origin feature/amazing-feature`)
|
|
310
|
+
5. 创建 Pull Request
|
|
311
|
+
|
|
312
|
+
### 代码规范
|
|
313
|
+
|
|
314
|
+
- 使用 TypeScript 编写代码
|
|
315
|
+
- 遵循 ESLint 规则
|
|
316
|
+
- 编写组件单元测试
|
|
317
|
+
- 更新相关文档
|
|
318
|
+
|
|
319
|
+
## 🐛 问题反馈
|
|
320
|
+
|
|
321
|
+
如果你遇到任何问题或有功能建议,请:
|
|
322
|
+
|
|
323
|
+
1. 查看 [现有问题](https://github.com/ShusterLi/fantasia-ui/issues)
|
|
324
|
+
2. 如果没有相关问题,请创建新 issue
|
|
325
|
+
3. 提供详细的重现步骤和环境信息
|
|
326
|
+
|
|
327
|
+
## 📄 许可证
|
|
328
|
+
|
|
329
|
+
本项目基于 [MIT 许可证](LICENSE) 开源。
|
|
330
|
+
|
|
331
|
+
## 🙏 致谢
|
|
332
|
+
|
|
333
|
+
感谢所有为 Fantasia UI 做出贡献的开发者!
|
|
334
|
+
|
|
335
|
+
## 📞 联系方式
|
|
336
|
+
|
|
337
|
+
- GitHub: [@ShusterLi](https://github.com/ShusterLi)
|
|
338
|
+
- Email: [通过 GitHub Issues 联系](https://github.com/ShusterLi/fantasia-ui/issues)
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
<div align="center">
|
|
343
|
+
<sub>使用 ❤️ 构建 | Made with ❤️ by Shuster and Contributors</sub>
|
|
344
|
+
</div>
|