Merge branch 'game-view' of https://codefirst.iut.uca.fr/git/HyperSet/hyper-set into game-view
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
caf579da09
@ -1,16 +1,29 @@
|
|||||||
export default{
|
export default{
|
||||||
emits:[],
|
emits:['unSelected','selected'],
|
||||||
props: ['card'],
|
props: ['card','id'],
|
||||||
data: function(){
|
data: function(){
|
||||||
return{
|
return{
|
||||||
|
idUsed:"id"+this.id,
|
||||||
|
isClicked:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
clicked:function () {
|
clicked() {
|
||||||
|
if(!this.isClicked){
|
||||||
|
this.isClicked=true
|
||||||
|
document.querySelector(`#${this.idUsed}`).setAttribute("style","border: 2px solid red; margin: 20px; color: red; fontSize: 20px; cursor: pointer");
|
||||||
|
this.$emit('selected',this.id);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.isClicked=false
|
||||||
|
document.querySelector(`#${this.idUsed}`).setAttribute("style","border: 2px solid black; margin: 20px; color: red; fontSize: 20px; cursor: pointer");
|
||||||
|
this.$emit('unSelected',this.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template:`
|
template:`
|
||||||
<div v-bind:style="{margin:'20px', border: '2px solid black', color: 'red', fontSize: '20px' }">{{card}}</div>
|
<div v-bind:id="idUsed" v-bind:style="{border: '2px solid black',margin:'20px', color: 'red', fontSize: '20px', cursor: 'pointer' }" v-on:click="clicked">
|
||||||
|
{{card.attributes}}
|
||||||
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
Loading…
Reference in new issue