From e76a1ac73d4b189ce5826ca8851ecda4ac596ed0 Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Sat, 15 Jun 2024 20:47:53 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=A2=9E=E5=8A=A0=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/component.ts | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/utils/component.ts b/src/utils/component.ts index 053e6b4..018818b 100644 --- a/src/utils/component.ts +++ b/src/utils/component.ts @@ -8,11 +8,27 @@ const require = createRequire(import.meta.url) * */ export type ComponentCreateOpsionType = { - html_head?: string - html_name?: string + /** + * 扩展路径 + */ join_dir?: string - html_body?: string + /** + *生成的文件名 + */ + html_name?: string + /*** + * 是否保存并返回地址 + * 默认 true + */ file_create?: boolean + /** + * 插入头部的内容 + */ + html_head?: string + /** + * 底部插入的内容 + */ + html_body?: string } /** @@ -45,8 +61,8 @@ export class Component { const href = require('../../public/output.css') const DOCTYPE = '' const Link = `` - const head = `${Link}${options?.html_head}` - const body = ` ${str} ${options?.html_body ?? ''}` + const head = `${Link}${options?.html_head ?? ''}` + const body = `${str}${options?.html_body ?? ''}` const html = `${DOCTYPE}${head}${body}` if ( typeof options?.file_create == 'boolean' &&