This commit is contained in:
Your New SJW Waifu 2019-10-08 11:03:56 -05:00
parent 3c866ef350
commit 435f825e2e
1 changed files with 5 additions and 5 deletions

View File

@ -7,18 +7,18 @@ const Banner = {
timer: ''
}
},
created() {
this.updateBanner()
created () {
this.updateBanner()
this.timer = setInterval(this.updateBanner, 300000)
},
beforeDestroy() {
beforeDestroy () {
clearInterval(this.timer)
},
methods: {
updateBanner() {
updateBanner () {
const componentThis = this
const req = new XMLHttpRequest()
req.addEventListener('load', function() {
req.addEventListener('load', function () {
const json = JSON.parse (this.responseText)
componentThis.url = json.bannerUrl
console.log('new banner: ' + componentThis.url)