Differentiate the title of adding and editing menu and menu item (#794)

#### What type of PR is this?

/kind improvement

#### What this PR does / why we need it:

新增和修改菜单时,标题都为编辑菜单,存在歧义

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3022

#### Special notes for your reviewer:

测试方式:新增菜单和菜单项。然后再编辑菜单和菜单项,查看title是否一样

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/791/head^2
chengfeiyue 2022-12-22 16:04:29 +08:00 committed by GitHub
parent 4029dd8282
commit c6a0f2d0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -45,6 +45,10 @@ const isUpdateMode = computed(() => {
return !!formState.value.metadata.creationTimestamp;
});
const modalTitle = computed(() => {
return isUpdateMode.value ? "编辑菜单" : "新增菜单";
});
const handleCreateMenu = async () => {
try {
saving.value = true;
@ -107,7 +111,7 @@ watch(
<VModal
:visible="visible"
:width="500"
title="编辑菜单"
:title="modalTitle"
@update:visible="onVisibleChange"
>
<FormKit

View File

@ -52,6 +52,10 @@ const isUpdateMode = computed(() => {
return !!formState.value.metadata.creationTimestamp;
});
const modalTitle = computed(() => {
return isUpdateMode.value ? "编辑菜单项" : "新增菜单项";
});
const handleSaveMenuItem = async () => {
try {
saving.value = true;
@ -240,7 +244,7 @@ const onMenuItemSourceChange = () => {
<VModal
:visible="visible"
:width="500"
title="编辑菜单项"
:title="modalTitle"
@update:visible="onVisibleChange"
>
<FormKit