- 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'],
})
推薦閱讀
- The Complete Rust Programming Reference Guide
- Docker and Kubernetes for Java Developers
- C語言程序設計(第2 版)
- 前端跨界開發指南:JavaScript工具庫原理解析與實戰
- Mastering Python Scripting for System Administrators
- Java項目實戰精編
- Spring快速入門
- Web前端應用開發技術
- Exploring SE for Android
- Photoshop智能手機APP界面設計
- WebStorm Essentials
- Java多線程并發體系實戰(微課視頻版)
- Spark技術內幕:深入解析Spark內核架構設計與實現原理
- JavaWeb從入門到精通(視頻實戰版)
- PHP動態網站開發實踐教程