add refs to cards
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.card
|
.card(:class="checkReference")
|
||||||
a.card--link(:href="url" :target='title' rel='noreferrer')
|
a.card--link(:href="url" :target='title' rel='noreferrer')
|
||||||
p.card--title {{title}}
|
p.card--title {{title}}
|
||||||
p.card--description {{desc}}
|
p.card--description {{desc}}
|
||||||
@@ -9,6 +9,24 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: ['title', 'desc', 'url'],
|
props: ['title', 'desc', 'url'],
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
isReferenced: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
checkReference(){
|
||||||
|
if(typeof this.$route.hash !== undefined) {
|
||||||
|
const query = this.$route.hash.substring(1);
|
||||||
|
const title = this.$props.title.replace(/ /g, '');
|
||||||
|
|
||||||
|
console.log(title.toLowerCase(), query)
|
||||||
|
return {
|
||||||
|
'card--active': title.toLowerCase() === query
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -23,6 +41,9 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
&--active{
|
||||||
|
border: 1px solid red !important;
|
||||||
|
}
|
||||||
|
|
||||||
&--link {
|
&--link {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Reference in New Issue
Block a user