- Vue.js 2 Web Development Projects
- Guillaume Chau
- 86字
- 2021-07-02 22:34:35
The 'player turn' overlay
The first overlay will display two different messages to the current player, depending on whether it is skipping their turn or not. The player prop will receive the current player so that we can access its data. We will use a v-if directive paired with a v-else directive and the skipTurn property we just added to the players:
Vue.component('overlay-content-player-turn', {
template: `<p>
<p class="big" v-if="player.skipTurn">{{ player.name }}, <br>your turn is skipped!</p>
<p class="big" v-else>{{ player.name }},<br>your turn has come!</p>
<p>Tap to continue</p>
</p>`,
props: ['player'],
})
推薦閱讀
- OpenCV for Secret Agents
- Android 7編程入門經(jīng)典:使用Android Studio 2(第4版)
- Practical Windows Forensics
- SQL Server 2012數(shù)據(jù)庫管理與開發(fā)項目教程
- Getting Started with NativeScript
- Python3.5從零開始學(xué)
- 零基礎(chǔ)學(xué)C語言(第4版)
- 貫通Tomcat開發(fā)
- 你真的會寫代碼嗎
- C語言程序設(shè)計
- Raspberry Pi Robotic Projects
- Laravel 5.x Cookbook
- Python程序員面試算法寶典
- iOS程序員面試筆試真題與解析
- Mastering VMware Horizon 6