A popup component for creating teams, used to collect basic team information. Supports avatar upload, name input, city selection, join review toggle, group chat QR code upload and other functions.
Features
- π Form Management - Complete team creation form including name, avatar, city and other information
- πΌοΈ Avatar Upload - Support team avatar upload and preview
- π City Selection - Support selecting team location
- π Review Toggle - Set whether team joining requires review
- π± QR Code Upload - Support uploading group chat QR code
- π¨ Theme Customization - Rich CSS variables for theme customization
- π§ Flexible Configuration - Support custom button text, default data, etc.
Use Cases
- E-sports team creation
- Team activity grouping
- Online game guild creation
- Sports event team registration
Import
Code Demo
Basic Usage
With Default Data
Custom Button Text
Custom Theme
API
Props
| Parameter | Description | Type | Default |
| custom-class | Custom style class | string | '' |
| show | Whether to show popup | boolean | false |
| z-index | PopupPlus z-index | number | 100 |
| button-text | Button text | string | 'Create Team and Register' |
| default-data | Default form data | Partial<FormData> | {} |
| size | Switch component size | string | '18' |
| active-color | Switch active color | string | '#366ff4' |
| inactive-color | Switch inactive color | string | '#fff' |
Events
| Event | Description | Parameters |
| close | Triggered when closing popup | - |
| submit | Triggered when clicking submit button | data: FormData |
| upload-avatar | Triggered when clicking upload avatar | - |
| upload-qrcode | Triggered when clicking upload QR code | - |
| select-city | Triggered when clicking select city | - |
| select-requirement | Triggered when clicking select requirement | - |
| team-name-change | Triggered when team name changes | name: string |
| no-review-change | Triggered when review toggle changes | value: boolean |
Notes
Usage Recommendations
- Image Upload: The component does not handle image upload logic itself. You need to implement upload functionality in the
upload-avatar and upload-qrcode events - City Selection: Open the city selector in the
select-city event and update the selected city through default-data - Recruitment Requirements: Open the selector in the
select-requirement event and update the selected requirement through default-data - Form Validation: It is recommended to perform form validation in the
submit event, such as team name length, whether avatar is uploaded, etc. - Input Limits: Team name is limited to 1-20 characters
- Image Size: It is recommended that avatar images be square with size 72x72 or larger; QR code images should be 160x160 or larger
- Component uses virtual nodes to reduce DOM hierarchy
- Images are recommended to use CDN acceleration
- Compress images before uploading
- Styles use CSS variables for easy dynamic theme switching
Compatibility
- Supports Vue 3.0+
- Compatible with modern browsers (Chrome 60+, Firefox 60+, Safari 12+)
- Supports WeChat Mini Program, Alipay Mini Program and other platforms
Theme Customization
Style Variables
The component provides the following CSS variables for custom styling. Please refer to the ConfigProvider component for usage.
Spacing System
| Name | Default | Description |
| --ctp-upload-size | .8rem | Upload button size |
| --ctp-option-height | 1.12rem | Option height |
Box Model System
| Name | Default | Description |
| --ctp-name-input-height | .72rem | Name input height |
Color System
| Name | Default | Description |
| --ctp-text-color-secondary | $color-text-invert-default | Secondary text color |
| --ctp-text-color-primary | $color-text-primary | Primary text color |
| --ctp-avatar-border-color | $color-divider-light | Avatar border color |
| --ctp-border-color | $color-border-tertiary | Border color |
| --ctp-avatar-color | $color-surface-default | Avatar icon color |
| --ctp-avatar-bg-color | $color-surface-brand | Avatar background color |
| --ctp-upload-bg | $color-surface-secondary | Upload area background |
| --ctp-upload-icon-color | $color-border-secondary | Upload icon color |
| --ctp-upload-border-color | $color-divider-default | Upload border color |
Typography System
| Name | Default | Description |
| --ctp-label-font-size | $font-size-lg | Label font size |
| --ctp-input-font-size | $font-size-md | Input font size |
| --ctp-arrow-font-size | $font-size-xl | Arrow font size |
| --ctp-avatar-icon-size | $font-size-sm | Avatar icon size |
| --ctp-upload-icon-size | $font-size-xl | Upload icon size |
Border Radius System
| Name | Default | Description |
| --ctp-avatar-radius | 50% | Avatar border radius |