- 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'],
})
推薦閱讀
- ThinkPHP 5實戰(zhàn)
- Developing Middleware in Java EE 8
- VMware vSphere 6.7虛擬化架構實戰(zhàn)指南
- 深入淺出RxJS
- 青少年Python編程入門
- Mastering React
- LabVIEW虛擬儀器入門與測控應用100例
- Vue.js 2 Web Development Projects
- Geospatial Development By Example with Python
- GameMaker Essentials
- Python商務數(shù)據(jù)分析(微課版)
- 創(chuàng)意UI Photoshop玩轉移動UI設計
- Java Hibernate Cookbook
- 快樂編程:青少年思維訓練
- HTML5與CSS3權威指南