show card desc on chooser

This commit is contained in:
Alberto Xamin 2020-11-22 12:49:57 +01:00
parent f0d51aa464
commit 7ccbacfb63
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -2,8 +2,9 @@
<div id="overlay" class="center-stuff"> <div id="overlay" class="center-stuff">
<h1>{{text}}</h1> <h1>{{text}}</h1>
<div> <div>
<Card v-for="c in cards" v-bind:key="c" :card="c" @click.native="select(c)"/> <Card v-for="c in cards" v-bind:key="c" :card="c" @click.native="select(c)" @mouseover.native="showDesc(c)" @mouseleave.native="desc=''"/>
</div> </div>
<p v-if="desc" style="bottom:20%;position:absolute;margin:16pt;">{{desc}}</p>
</div> </div>
</template> </template>
@ -20,6 +21,14 @@ export default {
select: Function, select: Function,
text: String, text: String,
}, },
data: () => ({
desc: ''
}),
methods: {
showDesc(card) {
this.desc = card.desc
}
}
} }
</script> </script>