From 08f9b41e93e264e17b7953b0868b360a560233d8 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sun, 11 Oct 2026 14:42:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(09-08):=20toolbox=20=E5=8D=95=E5=87=BB?= =?UTF-8?q?=E9=80=89=E4=B8=AD=20/=20=E5=86=8D=E7=82=B9=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20/=20=E5=8F=B3=E4=B8=8B=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 单击道具行选中,再次点击已选中项调用 heroState.items.useItem - 右下退出按钮调用 props.controller.close(props.instance) - 无丢弃 / 拖拽(D-36) - 已忽略全角/半角措辞 --- packages-user/client-modules/src/ui/toolbox.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages-user/client-modules/src/ui/toolbox.tsx b/packages-user/client-modules/src/ui/toolbox.tsx index 0fadfa0..91d00ad 100644 --- a/packages-user/client-modules/src/ui/toolbox.tsx +++ b/packages-user/client-modules/src/ui/toolbox.tsx @@ -83,13 +83,20 @@ export const ToolBox = defineComponent(props => { }); /** - * 点击道具行,将点击的道具设为当前选中项 + * 点击道具行:未选中时仅选中,再次点击已选中的道具时使用该道具 * @param item 被点击的道具状态 */ const clickItem = (item: IHeroItemState) => { + if (selected.value === item.num) { + hero.items.useItem(item.num); + return; + } selected.value = item.num; }; + /** 关闭当前道具栏界面 */ + const exit = () => props.controller.close(props.instance); + return () => { const current = selectedItem.value; return ( @@ -252,6 +259,7 @@ export const ToolBox = defineComponent(props => { font={titleFont} cursor="pointer" fillStyle="#ffffff" + onClick={exit} /> );