店铺设置页面监听游戏信息更新
This commit is contained in:
parent
76eb1bb388
commit
5f2a11b038
@ -114,7 +114,7 @@ import {
|
||||
saveShopGameInfo
|
||||
} from '@/api/shop'
|
||||
import { UserModule } from '@/store/modules/user'
|
||||
import { EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
import { EVENT_GAME_UPDATE, EVENT_SHOP_UPDATE, EventBus } from '@/utils/event-bus'
|
||||
|
||||
@Component({
|
||||
name: 'GameSetting',
|
||||
@ -163,12 +163,16 @@ export default class extends Vue {
|
||||
} else {
|
||||
this.shop = UserModule.department
|
||||
}
|
||||
EventBus.$on(EVENT_GAME_UPDATE, () => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
|
||||
beforeDestory() {
|
||||
if (UserModule.level === 1) {
|
||||
EventBus.$off(EVENT_SHOP_UPDATE)
|
||||
}
|
||||
EventBus.$off(EVENT_GAME_UPDATE)
|
||||
}
|
||||
|
||||
@Watch('shop')
|
||||
|
Loading…
x
Reference in New Issue
Block a user