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