mirror of
https://github.com/motajs/template.git
synced 2026-10-15 09:50:16 +08:00
feat(09-08): toolbox 单击选中 / 再点使用 / 右下退出
- 单击道具行选中,再次点击已选中项调用 heroState.items.useItem - 右下退出按钮调用 props.controller.close(props.instance) - 无丢弃 / 拖拽(D-36) - 已忽略全角/半角措辞
This commit is contained in:
parent
f039ebc542
commit
08f9b41e93
@ -83,13 +83,20 @@ export const ToolBox = defineComponent<ToolBoxProps>(props => {
|
||||
});
|
||||
|
||||
/**
|
||||
* 点击道具行,将点击的道具设为当前选中项
|
||||
* 点击道具行:未选中时仅选中,再次点击已选中的道具时使用该道具
|
||||
* @param item 被点击的道具状态
|
||||
*/
|
||||
const clickItem = (item: IHeroItemState<IHeroAttr>) => {
|
||||
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<ToolBoxProps>(props => {
|
||||
font={titleFont}
|
||||
cursor="pointer"
|
||||
fillStyle="#ffffff"
|
||||
onClick={exit}
|
||||
/>
|
||||
</container>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user