From b327d205dd35d589d77d5418c16e78e7cbab6361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Weller?= Date: Thu, 16 May 2019 10:43:23 +0200 Subject: [PATCH] change to query --- components/Card.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/Card.vue b/components/Card.vue index 7ab7f94..f5ab2a8 100644 --- a/components/Card.vue +++ b/components/Card.vue @@ -23,9 +23,10 @@ export default { let currentPath = this.$router.history.current.path let reference = this.$props.title.replace(/ /g, '').toLowerCase() - await this.$copyText(`https://webgems.io${currentPath}#${reference}`) + await this.$copyText(`https://webgems.io${currentPath}?card=${reference}`) - this.$router.push(`${currentPath}#${reference}`) + this.$router.push(`${currentPath}?card=${reference}`) + this.$forceUpdate() } catch (e) { console.error(e); } @@ -34,8 +35,10 @@ export default { this.$router.push(`${this.$router.history.current.path}#${this.$props.title.replace(/ /g, '').toLowerCase()}`) }, checkReference(){ - if(typeof this.$route.hash !== undefined) { - const query = this.$route.hash.substring(1); + if(typeof this.$route.query.card != undefined) { + console.log(this.$route.query.card) + + const query = this.$route.query.card; const title = this.$props.title.replace(/ /g, ''); title.toLowerCase() === query