Created
November 3, 2019 10:27
-
-
Save vitorvargasdev/843e3c9834b3cef2abc807a01611b01b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div v-for="odd in odds" :key="odd.id"> | |
<span v-if="teste(odd)">{{ odd }}</span> | |
</div> | |
</div> | |
</template> | |
<script> | |
import axios from "axios"; | |
axios.defaults.headers.common = { | |
"X-Requested-With": "XMLHttpRequest", | |
"X-CSRF-TOKEN": window.csrf_token | |
}; | |
export default { | |
data() { | |
return { | |
odds: "", | |
show: false | |
}; | |
}, | |
methods: { | |
full_time_result_load(id) { | |
async function odds() { | |
let res = await axios.post("/api/inPlayEvent", { id }); | |
return res; | |
} | |
odds().then(response => { | |
this.odds = response.data; | |
}); | |
}, | |
teste(payload) { | |
switch(payload.type) | |
{ | |
case "MA": | |
switch(payload.NA) | |
{ | |
case "Fulltime Result": | |
this.show = true | |
break; | |
default: | |
this.show = false | |
break; | |
} | |
break; | |
case "PA": | |
if(this.show == true) | |
{ | |
return true | |
} | |
break; | |
} | |
} | |
}, | |
mounted() { | |
this.full_time_result_load(123); | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment