From 00343cd77b78de11e5f36ed847a514596ba23ef6 Mon Sep 17 00:00:00 2001 From: tlyong1992 Date: Wed, 8 Jun 2022 11:12:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E7=89=87URL=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/NotionPage.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/NotionPage.js b/components/NotionPage.js index ead0d0ba..7c25f2dc 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -58,15 +58,14 @@ const NotionPage = ({ post }) => { } } + // 相册中的url替换成可点击 const cards = document.getElementsByClassName('notion-collection-card') for (const e of cards) { e.removeAttribute('href') const links = e.querySelectorAll('.notion-link') if (links && links.length > 0) { for (const l of links) { - l.onclick = function() { - window.open('http://' + l.innerText) - } + l.parentElement.innerHTML = `${l.innerText}` } } } @@ -74,7 +73,7 @@ const NotionPage = ({ post }) => { }, 800) addWatch4Dom() - }) + }, []) return