mirror of https://github.com/halo-dev/halo
refactor: simplify post settings form fields (#6539)
#### What type of PR is this? /area ui /kind improvement /milestone 2.19.0 #### What this PR does / why we need it: 简化文章设置表单的部分表单项。 <img width="760" alt="image" src="https://github.com/user-attachments/assets/337a728e-8cc6-4c9e-aa85-dc4c64b72de5"> #### Does this PR introduce a user-facing change? ```release-note 简化文章设置表单的部分表单项。 ```pull/6542/head
parent
9fbf66d496
commit
15a3e78e61
|
@ -328,15 +328,11 @@ const { handleGenerateSlug } = useSlugify(
|
||||||
</FormKit>
|
</FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.excerpt.autoGenerate"
|
v-model="formState.spec.excerpt.autoGenerate"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
name="autoGenerate"
|
name="autoGenerate"
|
||||||
:label="
|
:label="
|
||||||
$t('core.page.settings.fields.auto_generate_excerpt.label')
|
$t('core.page.settings.fields.auto_generate_excerpt.label')
|
||||||
"
|
"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
>
|
>
|
||||||
</FormKit>
|
</FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
|
@ -366,23 +362,15 @@ const { handleGenerateSlug } = useSlugify(
|
||||||
<div class="mt-5 divide-y divide-gray-100 md:col-span-3 md:mt-0">
|
<div class="mt-5 divide-y divide-gray-100 md:col-span-3 md:mt-0">
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.allowComment"
|
v-model="formState.spec.allowComment"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
name="allowComment"
|
name="allowComment"
|
||||||
:label="$t('core.page.settings.fields.allow_comment.label')"
|
:label="$t('core.page.settings.fields.allow_comment.label')"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.pinned"
|
v-model="formState.spec.pinned"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
:label="$t('core.page.settings.fields.pinned.label')"
|
:label="$t('core.page.settings.fields.pinned.label')"
|
||||||
name="pinned"
|
name="pinned"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.visible"
|
v-model="formState.spec.visible"
|
||||||
|
|
|
@ -355,15 +355,11 @@ const showCancelPublishButton = computed(() => {
|
||||||
/>
|
/>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.excerpt.autoGenerate"
|
v-model="formState.spec.excerpt.autoGenerate"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
name="autoGenerate"
|
name="autoGenerate"
|
||||||
:label="
|
:label="
|
||||||
$t('core.post.settings.fields.auto_generate_excerpt.label')
|
$t('core.post.settings.fields.auto_generate_excerpt.label')
|
||||||
"
|
"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
>
|
>
|
||||||
</FormKit>
|
</FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
|
@ -398,22 +394,14 @@ const showCancelPublishButton = computed(() => {
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.allowComment"
|
v-model="formState.spec.allowComment"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
:label="$t('core.post.settings.fields.allow_comment.label')"
|
:label="$t('core.post.settings.fields.allow_comment.label')"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.pinned"
|
v-model="formState.spec.pinned"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
:label="$t('core.post.settings.fields.pinned.label')"
|
:label="$t('core.post.settings.fields.pinned.label')"
|
||||||
name="pinned"
|
name="pinned"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-model="formState.spec.visible"
|
v-model="formState.spec.visible"
|
||||||
|
|
|
@ -135,13 +135,9 @@ const publishTimeHelp = computed(() => {
|
||||||
/>
|
/>
|
||||||
<FormKit
|
<FormKit
|
||||||
:value="true"
|
:value="true"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
name="excerptAutoGenerate"
|
name="excerptAutoGenerate"
|
||||||
:label="$t('core.post.settings.fields.auto_generate_excerpt.label')"
|
:label="$t('core.post.settings.fields.auto_generate_excerpt.label')"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
>
|
>
|
||||||
</FormKit>
|
</FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
|
@ -170,21 +166,13 @@ const publishTimeHelp = computed(() => {
|
||||||
<div class="mt-5 divide-y divide-gray-100 md:col-span-3 md:mt-0">
|
<div class="mt-5 divide-y divide-gray-100 md:col-span-3 md:mt-0">
|
||||||
<FormKit
|
<FormKit
|
||||||
name="allowComment"
|
name="allowComment"
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
:label="$t('core.post.settings.fields.allow_comment.label')"
|
:label="$t('core.post.settings.fields.allow_comment.label')"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
:options="[
|
|
||||||
{ label: $t('core.common.radio.yes'), value: true },
|
|
||||||
{ label: $t('core.common.radio.no'), value: false },
|
|
||||||
]"
|
|
||||||
:label="$t('core.post.settings.fields.pinned.label')"
|
:label="$t('core.post.settings.fields.pinned.label')"
|
||||||
name="pinned"
|
name="pinned"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
:options="[
|
:options="[
|
||||||
|
|
Loading…
Reference in New Issue