From 138120514cf3ef3156ab665f36f2a176dc0ca3a9 Mon Sep 17 00:00:00 2001 From: Kaihotsu Kotaro Date: Tue, 22 Dec 2020 12:25:50 +0900 Subject: [PATCH] =?UTF-8?q?[update]=20=E3=83=84=E3=82=A4=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0#63?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/_nodeId/_articleId.vue | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pages/_nodeId/_articleId.vue b/pages/_nodeId/_articleId.vue index 5614ff4..d63844d 100644 --- a/pages/_nodeId/_articleId.vue +++ b/pages/_nodeId/_articleId.vue @@ -3,7 +3,7 @@

{{ title }}

-

かいたひと : {{authorName}}

+

かいたひと : {{ authorName }}

{{ zbzb_count }} ずぶずぶ! {{ zbzb_count }} ずぶった! + +
@@ -50,7 +56,8 @@ export default { isZbzbPushed: false, articleId: null, currentTagId: null, - authorName:"名無しさん", + authorName: "名無しさん", + shareUrl: "", markdownOption: { bold: true, italic: true, @@ -70,8 +77,8 @@ export default { fullscreen: false, readmodel: true, htmlcode: true, - help: true, - }, + help: true + } }; }, @@ -86,7 +93,7 @@ export default { this.currentTagId = this.$route.params.nodeId; const article = await this.$getArticle(this.articleId); this.content = article.body; - this.authorName=article.author?article.author:"名無しさん" + this.authorName = article.author ? article.author : "名無しさん"; this.title = article.title; if (article.zbzbCount == null) { this.zbzb_count = 0; @@ -94,13 +101,12 @@ export default { this.zbzb_count = article.zbzbCount; } const getTagsInfo = []; - article.tags.forEach((tag) => { + article.tags.forEach(tag => { getTagsInfo.push(this.$getTag(tag)); }); - Promise.all(getTagsInfo).then((values) => { - this.tags = values; - console.log(values); - }); + this.tags = await Promise.all(getTagsInfo); + const tweetText = `hobeeeeeeの「${this.title}」で${this.tags[0].name}の沼を覗こう!!`; + this.shareUrl = `https://twitter.com/share?text=${tweetText}&url=${location.href}`; }, methods: { @@ -118,6 +124,9 @@ export default { this.$updateZbzbCount(this.articleId, 1); } }, - }, + goTwitter(){ + window.open(this.shareUrl) + } + } };