fix: 支持编辑分类
- 分类项添加编辑按钮 - 悬停时显示编辑按钮 - 点击编辑按钮打开编辑弹窗
This commit is contained in:
@@ -144,10 +144,15 @@ function App() {
|
||||
</div>
|
||||
|
||||
{categories.map(cat => (
|
||||
<div key={cat.id} className={`category-item ${selectedCategory === cat.id ? 'active' : ''}`} onClick={() => setSelectedCategory(cat.id)}>
|
||||
<div className="category-icon"><Icon name={cat.icon || 'folder'} size={14}/></div>
|
||||
<span className="category-name">{cat.name}</span>
|
||||
<span className="category-count">{getCategoryCount(cat.id)}</span>
|
||||
<div key={cat.id} className="category-item-wrapper">
|
||||
<div className={`category-item ${selectedCategory === cat.id ? 'active' : ''}`} onClick={() => setSelectedCategory(cat.id)}>
|
||||
<div className="category-icon"><Icon name={cat.icon || 'folder'} size={14}/></div>
|
||||
<span className="category-name">{cat.name}</span>
|
||||
<span className="category-count">{getCategoryCount(cat.id)}</span>
|
||||
</div>
|
||||
<button className="category-edit-btn" onClick={(e) => { e.stopPropagation(); openModal('category', cat) }} title="编辑">
|
||||
<Icon name="edit" size={12}/>
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user