diff --git a/src/components/Definition.vue b/src/components/Definition.vue index 600f882d08d0e6ea5746043f04c336cc5c3ce25a..73d9e1553807081cf75da6fad0b4d93bbb3d757d 100644 --- a/src/components/Definition.vue +++ b/src/components/Definition.vue @@ -1,5 +1,5 @@ <template> - <li class="definition" :id="'def' + body.id"> + <li class="definition" :ref="'def' + body.id" :id="'def' + body.id"> <ul> <li :is="element_wrapper.template" :body="element_wrapper.element" v-for="element_wrapper in template_name_added">{{element_wrapper.element}}</li> </ul> @@ -37,6 +37,13 @@ var Definition = { } }) } + }, + mounted: function()Â { + let ref = 'def' + this.body.id + if(location.hash.substring(1) == ref){ + this.$refs[ref].scrollIntoView() + this.$refs[ref].classList.add('highlighted') + } } } @@ -46,4 +53,9 @@ export default Definition li.quote { font-style: italic; } + +.highlighted { + background-color: #ddddff; + border-radius: 5px; +} </style>