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 + } }