Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
feat: add target attribute setting for menu item (#805)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind feature

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

支持为菜单项设置链接打开方式。 适配:halo-dev/halo#3072

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

Fixes halo-dev/halo#3063

#### Screenshots:

<img width="714" alt="image" src="https://user-images.githubusercontent.com/21301288/209922511-120bc82c-4d13-4dd8-9829-0ba173cdc377.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev/halo#3072 的分支。
2. Console 需要 `pnpm install`
3. 创建若干菜单项,并设置打开方式。
4. 检查是否设置正确。

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

```release-note
菜单项支持设置打开方式
```
  • Loading branch information
ruibaby authored Dec 29, 2022
1 parent 565efcb commit ad5348d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@formkit/utils": "^1.0.0-beta.12",
"@formkit/validation": "1.0.0-beta.12",
"@formkit/vue": "^1.0.0-beta.12",
"@halo-dev/api-client": "0.0.65",
"@halo-dev/api-client": "0.0.66",
"@halo-dev/components": "workspace:*",
"@halo-dev/console-shared": "workspace:*",
"@halo-dev/richtext-editor": "^0.0.0-alpha.17",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions src/modules/interface/menus/components/MenuItemEditingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const initialFormState: MenuItem = {
spec: {
displayName: "",
href: "",
target: "_self",
children: [],
priority: 0,
},
Expand Down Expand Up @@ -327,6 +328,31 @@ const onMenuItemSourceChange = () => {
:type="selectedRef.inputType"
validation="required"
/>
<FormKit
v-model="formState.spec.target"
label="打开方式"
type="select"
name="target"
:options="[
{
label: '当前窗口',
value: '_self',
},
{
label: '新窗口',
value: '_blank',
},
{
label: '父窗口',
value: '_parent',
},
{
label: '顶级窗口',
value: '_top',
},
]"
/>
</div>
</div>
</div>
Expand Down

1 comment on commit ad5348d

@vercel
Copy link

@vercel vercel bot commented on ad5348d Dec 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

halo-admin-ui.vercel.app
ui-git-main-halo-dev.vercel.app
ui-halo-dev.vercel.app

Please sign in to comment.