|
@@ -11,6 +11,11 @@ const routes = [
|
|
|
path: '/',
|
|
|
name: 'HomeView',
|
|
|
component: HomeView,
|
|
|
+ beforeEnter (to, from, next) {
|
|
|
+ const audioNode = document.getElementById('global-audio')
|
|
|
+ audioNode.pause()
|
|
|
+ next()
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
path: '/relics-appr',
|
|
@@ -30,7 +35,15 @@ const routes = [
|
|
|
canFullScreen: false,
|
|
|
}
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ beforeEnter (to, from, next) {
|
|
|
+ const audioNode = document.getElementById('global-audio')
|
|
|
+ if (audioNode.src !== require(`@/assets/audios/${globalConfig.audioName.relicsAppr}.mp3`)) {
|
|
|
+ audioNode.src = require(`@/assets/audios/${globalConfig.audioName.relicsAppr}.mp3`)
|
|
|
+ audioNode.play()
|
|
|
+ }
|
|
|
+ next()
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
path: '/about',
|