From 981d6053c59d969ee541685b0c4ed2f573fd5c35 Mon Sep 17 00:00:00 2001 From: p_craft Date: Sat, 4 Jan 2025 11:36:48 +0900 Subject: [PATCH] =?UTF-8?q?URL=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Nanimachi100Result.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Nanimachi100Result.vue b/src/components/Nanimachi100Result.vue index 54fe6d0..37ea649 100644 --- a/src/components/Nanimachi100Result.vue +++ b/src/components/Nanimachi100Result.vue @@ -34,19 +34,20 @@ const text = computed( 問題モード: ${type === 'tamenmachi' ? '多面待ち' : '通常'} 手牌枚数: ${length}`, ) -const url = 'https://menchin.p_craft.dev/nanimachi100' +const url = encodeURIComponent('https://menchin.p_craft.dev/nanimachi100') const shareText = computed( () => `${text.value} ${url}`, ) const handleShare = async () => { const isSP = navigator.userAgent.match(/(iPhone|iPad|iPod|Android)/) - if (isSP) { - await navigator.share({ - title: '何待ち100本ノック', - text: text.value, - url, - }) + const shareData = { + title: '何待ち100本ノック', + text: shareText.value, + url, + } + if (isSP && navigator.canShare(shareData)) { + await navigator.share(shareData) return } else { shareDialog.value?.open()