refactor: 优化后台表单中 Slug 生成按钮的布局与显示样式
continuous-integration/drone/push Build is passing

This commit is contained in:
seahi committed 2026-08-07 14:33:48 +08:00
1 parent 874d8d2e6e
commit 86a3facc63
4 files changed
+30 -31

No files matched your search

+13 -13
View File
@@ -53,8 +53,19 @@
/>
</div>
<div class="form-group">
<label for="slug">别名</label>
<div style="display: flex; gap: 0.5rem; align-items: center;">
<div
style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem;"
>
<label for="slug" style="margin: 0;">别名</label>
<button
type="button"
class="btn btn-secondary"
style="padding: 0.2rem 0.6rem; font-size: 0.8rem; cursor: pointer;"
onclick={() => slugHandler.forceGenerate(name)}
>
重新生成
</button>
</div>
<input
type="text"
id="slug"
@@ -62,18 +73,7 @@
bind:value={slug}
oninput={handleSlugInput}
placeholder="例如: tech-sharing"
style="flex: 1;"
/>
<button
type="button"
class="btn btn-secondary"
style="padding: 0.4rem 0.6rem; cursor: pointer;"
title="生成英文 Slug"
onclick={() => slugHandler.forceGenerate(name)}
>
🔄
</button>
</div>
</div>
<button type="submit" class="btn btn-primary">创建</button>
</form>
+2 -3
View File
@@ -107,11 +107,10 @@
<button
type="button"
class="btn btn-secondary"
style="padding: 0.2rem 0.5rem; font-size: 0.8rem; cursor: pointer;"
title="生成英文 Slug"
style="padding: 0.2rem 0.6rem; font-size: 0.8rem; cursor: pointer;"
onclick={() => slugHandler.forceGenerate(title)}
>
🔄 生成
重新生成
</button>
</div>
<input
+2 -2
View File
@@ -517,11 +517,11 @@
<button
type="button"
class="btn btn-secondary"
style="padding: 0.2rem 0.5rem; font-size: 0.8rem; cursor: pointer;"
style="padding: 0.2rem 0.6rem; font-size: 0.8rem; cursor: pointer;"
title="生成英文 Slug"
onclick={() => slugHandler.forceGenerate(title)}
>
🔄 生成
重新生成
</button>
</div>
<input
+13 -13
View File
@@ -47,8 +47,19 @@
required
/>
<label for="slug">URL 别名 *</label>
<div style="display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem;">
<div
style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem;"
>
<label for="slug" style="margin: 0;">URL 别名 *</label>
<button
type="button"
class="btn btn-secondary"
style="padding: 0.2rem 0.6rem; font-size: 0.8rem; cursor: pointer;"
onclick={() => slugHandler.forceGenerate(name)}
>
重新生成
</button>
</div>
<input
id="slug"
name="slug"
@@ -56,18 +67,7 @@
bind:value={slug}
oninput={handleSlugInput}
required
style="flex: 1;"
/>
<button
type="button"
class="btn btn-secondary"
style="padding: 0.4rem 0.6rem; cursor: pointer;"
title="生成英文 Slug"
onclick={() => slugHandler.forceGenerate(name)}
>
🔄
</button>
</div>
<label for="description">描述</label>
<textarea