Component Update & Version Management
Iterate versions of published components, fix issues, or add new features.
Update Process
1. Download Component
Go to "My Components", find the component that needs updating, and click the "Update" button. On the update page:
- Click "Download" to get the current version
- Select the save path (project's components directory)
- Confirm download is complete
2. Local Modification
Open the downloaded component folder in your project and make modifications:
- Fix bugs
- Add new features
- Optimize performance
- Update documentation
3. Testing & Validation
Test the modified component in the local environment to ensure:
- Original functions work normally
- New features work as expected
- No console errors
4. Upload Update
Return to comp-hub's update page:
- Select the modified component folder
- Update version number (if file content has changed)
- Adjust preview configuration (if needed)
- Modify component description (recommended to explain changes)
- Click "Update" to publish
Version Number Specification
Component versions follow the Semantic Versioning specification:
major.minor.patch| Version Type | Change Content | Example |
|---|---|---|
| Patch Version | Bug fixes, backward compatible | 1.0.0 → 1.0.1 |
| Minor Version | New features, backward compatible | 1.0.0 → 1.1.0 |
| Major Version | Breaking changes | 1.0.0 → 2.0.0 |
When to Update Version Number
Must Update:
- Modified component code (.vue file)
- Changed component props interface
- Adjusted component behavior logic
No Need to Update:
- Only modified preview configuration
- Only updated component description
How to Modify Version Number
Method 1: Modify on Update Page (Recommended)
In the configuration area of the component update page, directly modify the version number input box, and the system will automatically update the comp.json file.
Method 2: Manual Local Modification
Manually modify the version number in comp.json in the local project:
{
"name": "MyComponent",
"version": "1.1.0"
}Version Management
Multiple Versions Coexist
The platform retains all historical versions of components. Users can:
- Switch to view different versions on the preview page
- Download and use any historical version
- Compare differences between versions
Best Practices
Changelog
Maintain a changelog in the component's README.md:
## Changelog
### 1.1.0 (2024-01-15)
- Added: Support for custom theme colors
- Optimized: Improved rendering performance with large data volumes
### 1.0.1 (2024-01-10)
- Fixed: Fixed tooltip not displaying in certain situations
### 1.0.0 (2024-01-01)
- Initial version releaseBackward Compatibility
- Try to keep the props interface stable
- If you need to deprecate a property, mark it as deprecated in the documentation first
- Breaking changes must upgrade the major version number