From ad5348d63d99570c4358d3a69c0dbaf27669e439 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Thu, 29 Dec 2022 21:50:33 +0800 Subject: [PATCH] feat: add target attribute setting for menu item (#805) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature #### What this PR does / why we need it: 支持为菜单项设置链接打开方式。 适配:https://github.com/halo-dev/halo/pull/3072 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3063 #### Screenshots: image #### Special notes for your reviewer: 测试方式: 1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3072 的分支。 2. Console 需要 `pnpm install` 3. 创建若干菜单项,并设置打开方式。 4. 检查是否设置正确。 #### Does this PR introduce a user-facing change? ```release-note 菜单项支持设置打开方式 ``` --- package.json | 2 +- pnpm-lock.yaml | 8 +++--- .../menus/components/MenuItemEditingModal.vue | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6119b99d6..216150520 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6e167f5e..1e15345b6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: '@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 @@ -108,7 +108,7 @@ importers: '@formkit/utils': 1.0.0-beta.12-e579559 '@formkit/validation': 1.0.0-beta.12 '@formkit/vue': 1.0.0-beta.12-e579559_ior6jr3fpijijuwpr34w2i25va - '@halo-dev/api-client': 0.0.65 + '@halo-dev/api-client': 0.0.66 '@halo-dev/components': link:packages/components '@halo-dev/console-shared': link:packages/shared '@halo-dev/richtext-editor': 0.0.0-alpha.17_vue@3.2.45 @@ -1992,8 +1992,8 @@ packages: - windicss dev: false - /@halo-dev/api-client/0.0.65: - resolution: {integrity: sha512-00x5cDnXhjIHlTJ9CB9QDxyiWhJv48DWzKpKh/E1BvIB/umAqAG/S2TATB6z6GvOalOLXMfnQv6IfCb76wgl1Q==} + /@halo-dev/api-client/0.0.66: + resolution: {integrity: sha512-TxiNVki2FGUXYCy/zmvHQJV5BfXIF6dT3JwtoT0Vo6IjlN47lxND1y8ZV4QB+msj4u/jIF3s9skxzvMoyqRbog==} dev: false /@halo-dev/richtext-editor/0.0.0-alpha.17_vue@3.2.45: diff --git a/src/modules/interface/menus/components/MenuItemEditingModal.vue b/src/modules/interface/menus/components/MenuItemEditingModal.vue index 31335bc11..921adb308 100644 --- a/src/modules/interface/menus/components/MenuItemEditingModal.vue +++ b/src/modules/interface/menus/components/MenuItemEditingModal.vue @@ -34,6 +34,7 @@ const initialFormState: MenuItem = { spec: { displayName: "", href: "", + target: "_self", children: [], priority: 0, }, @@ -327,6 +328,31 @@ const onMenuItemSourceChange = () => { :type="selectedRef.inputType" validation="required" /> + +