update: 增加必要注释

This commit is contained in:
ningmengchongshui 2024-06-15 20:47:53 +08:00
parent 1dc768ec08
commit e76a1ac73d
1 changed files with 21 additions and 5 deletions

View File

@ -8,11 +8,27 @@ const require = createRequire(import.meta.url)
* *
*/ */
export type ComponentCreateOpsionType = { export type ComponentCreateOpsionType = {
html_head?: string /**
html_name?: string *
*/
join_dir?: string join_dir?: string
html_body?: string /**
*
*/
html_name?: string
/***
*
* true
*/
file_create?: boolean file_create?: boolean
/**
*
*/
html_head?: string
/**
*
*/
html_body?: string
} }
/** /**
@ -45,7 +61,7 @@ export class Component {
const href = require('../../public/output.css') const href = require('../../public/output.css')
const DOCTYPE = '<!DOCTYPE html>' const DOCTYPE = '<!DOCTYPE html>'
const Link = `<link rel="stylesheet" href="${href}"></link>` const Link = `<link rel="stylesheet" href="${href}"></link>`
const head = `<head>${Link}${options?.html_head}</head>` const head = `<head>${Link}${options?.html_head ?? ''}</head>`
const body = `<body>${str}${options?.html_body ?? ''}</body>` const body = `<body>${str}${options?.html_body ?? ''}</body>`
const html = `${DOCTYPE}<html>${head}${body}</html>` const html = `${DOCTYPE}<html>${head}${body}</html>`
if ( if (