feat: MenuItem에 funcCall 타입 추가후 처리

This commit is contained in:
2023-03-22 22:44:42 +09:00
parent 4d2b5ced82
commit ca3e64f3b9
6 changed files with 158 additions and 55 deletions
+16
View File
@@ -10,6 +10,7 @@
:globalInfo="globalInfo"
:modelValue="globalMenu"
variant="sammo-base2"
@reqCall="reqMenuCall"
/>
</div>
<GameInfo
@@ -220,6 +221,21 @@ const storeP = getGameConstStore().then((store) => {
gameConstStore.value = store;
});
const menuCallList: Record<string, ()=>unknown> = {
showVersion:()=>{
console.log('TODO version 출력');
},
}
function reqMenuCall(key:string){
if(!(key in menuCallList)){
console.error(`메뉴 호출 실패: ${key}`);
return;
}
const func = menuCallList[key];
void func();
}
const showSecret = computed(() => {
if (!frontInfo.value) {
return false;