Files
2025-10-03 16:49:53 +08:00

37 lines
781 B
Plaintext

<sence>
<sprite class="test-sprite" @click="console.log('Sprite clicked!')"></sprite>
<box class="test-box">Hello PE!</box>
<text class="test-text">Welcome to PE Engine</text>
<box for="{label,action} in boxList" @click="onMenuClick(action)" class="menu-item">
{{ label }}
</box>
<text for="{label} in boxList">
{{label}}
</text>
</sence>
<script>
const boxList = [{
label:"开始游戏",
action:"start"
},
{
label:"读取存档",
action:"loadgame"
}]
let count = 0
onLoad(()=>{
console.log("Scene loaded - Lifecycle callback working!")
})
onShow(()=>{
console.log("Scene shown - Lifecycle callback working!")
})
function onMenuClick(act){
count++;
console.log("Menu action:", act, count)
}
</script>