|
@@ -21,7 +21,8 @@ export default {
|
|
|
return {
|
|
|
isOpen: false,
|
|
|
newsNum: 0,
|
|
|
- noticeNum: 0
|
|
|
+ noticeNum: 0,
|
|
|
+ myInterval: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -48,12 +49,21 @@ export default {
|
|
|
mounted () {
|
|
|
this.addSelfToAllComponent()
|
|
|
this.getNews()
|
|
|
+ this.newsInterval()
|
|
|
// this.getNotice()
|
|
|
},
|
|
|
+ beforeDestroy () {
|
|
|
+ clearInterval(this.myInterval)
|
|
|
+ },
|
|
|
methods: {
|
|
|
addSelfToAllComponent () {
|
|
|
this.allComponent['main-navbar-news'] = this
|
|
|
},
|
|
|
+ newsInterval () {
|
|
|
+ this.myInterval = setInterval(() => {
|
|
|
+ this.getNews()
|
|
|
+ }, 1000 * 10)
|
|
|
+ },
|
|
|
showNews () {
|
|
|
// this.$parent.$parent.shownews()
|
|
|
// this.$parent.$refs.navbarmenu.gotoPageByUUID('fe9b5adf20975c1bd13fd38cee3b09a68VfGsVRBgJ3')
|