From 19faafd55aa1ba0fbbd7e4f9b819b0681511f398 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 24 Mar 2024 12:22:20 +0800 Subject: [PATCH] =?UTF-8?q?theme-movie=20=E5=8A=A0=E5=85=A5=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/movie/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/themes/movie/index.js b/themes/movie/index.js index 326781e1..96195bf2 100644 --- a/themes/movie/index.js +++ b/themes/movie/index.js @@ -198,14 +198,14 @@ const LayoutSlug = props => { // 如有外链、保存在data-src中 const iframe = wrapper.querySelector('iframe') if (iframe) { - iframe.setAttribute('data-src', iframe.getAttribute('src')) + iframe?.setAttribute('data-src', iframe?.getAttribute('src')) } // 如果是第一个元素,设置为 active if (index === 0) { carouselItem.classList.add('active') } else { - iframe.setAttribute('src', '') + iframe?.setAttribute('src', '') } // 将元素添加到容器中 @@ -227,7 +227,6 @@ const LayoutSlug = props => { document.querySelectorAll('.notion-carousel').forEach(item => { // 外链保存在data-src中 const iframe = item.querySelector('iframe') - console.log('iframe', iframe.getAttribute('data-src'), iframe.getAttribute('src')) // 判断当前元素是否包含该 figCaption 的文本内容,如果是则设置为 active,否则取消 active if (item.querySelector('figcaption').textContent.trim() === value) { @@ -265,7 +264,7 @@ const LayoutSlug = props => { setTimeout(() => { combineVideo() - }, 2000) + }, 1500) // 404 if (!post) {