- 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'],
})
推薦閱讀
- jQuery Mobile Web Development Essentials(Third Edition)
- 數據結構(Java語言描述)
- 算法訓練營:提高篇(全彩版)
- Getting Started with Hazelcast(Second Edition)
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- Java程序員面試筆試寶典(第2版)
- C#程序設計(項目教學版)
- Mastering Apache Storm
- 虛擬現實建模與編程(SketchUp+OSG開發技術)
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐
- 網頁設計與制作
- Socket.IO Cookbook
- Python網絡運維自動化
- Python數據科學實戰
- Java Web開發系統項目教程