瀏覽代碼

Correctif css non scopé + tracking paramètre route battleground

master
Adrien 4 年之前
父節點
當前提交
423459f0f7
共有 3 個檔案被更改,包括 18 行新增10 行删除
  1. +11
    -6
      src/components/Battleground.vue
  2. +6
    -3
      src/components/BattlegroundSelector.vue
  3. +1
    -1
      src/components/Hello.vue

+ 11
- 6
src/components/Battleground.vue 查看文件

@@ -1,5 +1,10 @@
<template>
<div>Welcome to {{ battleground.name }}</div>
<div class="battleground" v-if="battleground">
<div>Welcome to {{ battleground.name }}</div>
<router-link to="alteracPass">Go to Alterac Pass</router-link>
<router-link to="battlefieldOfEternity">Go to Battlefield Of Eternity</router-link>
<router-link to="/battlegrounds">Back to selector</router-link>
</div>
</template>

<script>
@@ -9,17 +14,17 @@
name: 'Battleground',
data () {
return {
battlegroundId: this.$route.params.battlegroundId,
battleground: BATTLEGROUNDS[this.$route.params.battlegroundId]
}
},
computed: {
battlegroundId () {
return this.$route.params.battlegroundId
},
battleground () {
return BATTLEGROUNDS[this.$route.params.battlegroundId]
}
},
watch: {
$route (to) {
this.battlegroundId = to.params.battlegroundId
}
}
}
</script>


+ 6
- 3
src/components/BattlegroundSelector.vue 查看文件

@@ -20,9 +20,6 @@
return {
maps: MAPS
}
},
mounted () {
console.log(MAPS)
}
}
</script>
@@ -38,3 +35,9 @@
border-top: solid #5659aa 1px
border-left: none
</style>

<style lang="sass" scoped>
a
text-decoration: none
color: inherit
</style>

+ 1
- 1
src/components/Hello.vue 查看文件

@@ -33,7 +33,7 @@ export default {
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="sass">
<style lang="sass" scoped>
h1, h2
font-weight: normal



Loading…
取消
儲存