whatever
This commit is contained in:
parent
3c866ef350
commit
435f825e2e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue