Skip to content
Snippets Groups Projects
Commit 87f562d2 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

prevent undefined error

parent 879d6449
No related branches found
No related tags found
No related merge requests found
...@@ -82,10 +82,12 @@ var Definition = { ...@@ -82,10 +82,12 @@ var Definition = {
watch:{ watch:{
$route(to, from) { $route(to, from) {
let ref = 'def' + this.body.id let ref = 'def' + this.body.id
if(location.hash.substring(1) == ref){ if (this.$refs[ref]) {
this.$refs[ref].classList.add('highlighted') if(location.hash.substring(1) == ref){
}else{ this.$refs[ref].classList.add('highlighted')
this.$refs[ref].classList.remove('highlighted') }else {
this.$refs[ref].classList.remove('highlighted')
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment