From 6b26c641b27ec6f5864e7f9eee036a54f86437c1 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Mon, 13 Oct 2025 14:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A0=B7=E5=BC=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=B7=A5=E5=85=B7-=E4=BD=93=E7=A7=AF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/composables/useImageStyles.ts | 37 ++----------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/app/composables/useImageStyles.ts b/app/composables/useImageStyles.ts index 232e837..8ede37c 100644 --- a/app/composables/useImageStyles.ts +++ b/app/composables/useImageStyles.ts @@ -16,7 +16,7 @@ export const useImageStyles = ( ) => { // 默认配置 const defaultOptions = { - maxWidth: 'calc(100%-0px)', + maxWidth: 'calc(100% - 0px)', margin: '15px 0', display: 'block', boxSizing: 'border-box', @@ -73,43 +73,10 @@ export const useImageStyles = ( } } - /** - * 手动触发图片样式处理 - */ - const triggerImageStyles = () => { - processImageStyles() - } - return { forceImageStyles, processImageStyles, initImageStyles, - triggerImageStyles - } -} - -/** - * 简化版本 - 直接处理图片样式 - * @param containerSelector 容器选择器 - * @param options 样式选项 - */ -export const useSimpleImageStyles = ( - containerSelector: string = '.article-content', - options: { - maxWidth?: string - margin?: string - display?: string - boxSizing?: string - } = {} -) => { - const {forceImageStyles, processImageStyles} = useImageStyles( - () => '', // 空函数,不监听内容变化 - containerSelector, - options - ) - - return { - forceImageStyles, - processImageStyles + } }