2020-08-26 08:22:05 +00:00
|
|
|
<template>
|
2020-09-06 10:38:26 +00:00
|
|
|
<!--Alert Bar-->
|
2020-08-26 08:22:05 +00:00
|
|
|
<div v-if="noAlert">
|
|
|
|
<div class="alert" :class="alert.color" role="alert">
|
|
|
|
{{ alert.text }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from "axios";
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
noAlert: true,
|
|
|
|
alert: ""
|
|
|
|
};
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.getAlert();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getAlert() {
|
|
|
|
this.noAlert = false;
|
|
|
|
axios.get("https://api.gabenparadise.com/api/alert").then(response => {
|
|
|
|
console.log(response);
|
|
|
|
if (response.status === 200) {
|
|
|
|
if (
|
|
|
|
response.data !== undefined ||
|
|
|
|
response.data !== null ||
|
|
|
|
response.data !== ""
|
|
|
|
) {
|
|
|
|
this.alert = response.data;
|
|
|
|
this.noAlert = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|