common

package
v1.2.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

templ: version: v0.3.977

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BookURL added in v1.1.5

func BookURL(bookID string) string

根据阅读模式生成书籍链接,如果是“{}”,templ 可能会把 { something } 解析成模板语法,而不是输出字面量。用 “ 来包裹就不会报错了

func DownloadButton added in v1.2.0

func DownloadButton(c echo.Context, book *model.Book) templ.Component

DownloadButton 下载按钮组件

func Drawer

func Drawer(c echo.Context, book *model.Book, slot templ.Component, showReturnIcon bool, returnUrl string) templ.Component
func Footer(version string) templ.Component

func GetBookTitle added in v1.1.0

func GetBookTitle(bookID string) string

GetBookTitle 获取页面标题

func GetFileBase64Text added in v1.1.0

func GetFileBase64Text(bookID string, fileName string) string

func GetPageTitle

func GetPageTitle(bookID string, nowBookNum int, storeBookInfos []model.StoreBookInfo, childBookInfos []model.BookInfo) string

GetPageTitle 获取页面标题

func GetReturnUrl

func GetReturnUrl(BookID string) string

GetReturnUrl 阅读或书架页面,返回按钮实际使用的链接

func Header(prop HeaderProps) templ.Component

bg-base-100/50 透明背景 backdrop-blur-sm 模糊背景 暂时没加上,因为现在不生效 可能是因为父元素或祖先元素上存在一些会创建新的层叠上下文或隔离背景的属性(例如 overflow: hidden、opacity<1、transform、filter、isolation 等)造成的

func HeaderTitle added in v1.1.5

func HeaderTitle(prop HeaderProps) templ.Component

<!-- 标题-->

func Html

func Html(c echo.Context, bodyContent templ.Component, insertScript []string) templ.Component

Html 定义网页布局

func MessageModal

func MessageModal() templ.Component

func QRCode

func QRCode() templ.Component

func QuickJumpBarBooks

func QuickJumpBarBooks(b *model.Book) (list *model.BookInfos)

func ReSortIcon added in v1.1.5

func ReSortIcon() templ.Component

func ReadModeSelect added in v1.1.0

func ReadModeSelect() templ.Component

切换【无限卷轴/分页卷轴/翻页阅读】的select

func ReadModeSwitchButton added in v1.1.0

func ReadModeSwitchButton() templ.Component

func ReadingHistory added in v1.1.8

func ReadingHistory() templ.Component

ReadingHistory 阅读历史记录列表组件(限制显示数量,默认10条) 用于各个页面的 drawer 侧边栏

func ReadingHistoryWithLimit added in v1.2.11

func ReadingHistoryWithLimit(limit int) templ.Component

ReadingHistoryWithLimit 阅读历史记录列表组件(可指定限制数量) 调用 /api/reading-history?limit=X 获取数据,后端已完成过滤和排序

func Toast

func Toast() templ.Component

Types

type HeaderProps

type HeaderProps struct {
	// 标题
	TitleText string
	// 是否显示返回图标
	ShowReturnIcon bool
	// 返回链接
	ReturnUrl string
	// 是否显示设置图标
	ShowServerSetting bool
	//是否显示上传图标
	ShowUploadIcon bool
	// 是否显示重排序图标
	ShowReSortIcon bool
	// 下载链接
	DownLoadLink string
	// 快速跳转,设置之后标题变为快速跳转栏
	QuickJumpBarBooks *model.BookInfos
}

Directories

Path Synopsis
templ: version: v0.3.977
templ: version: v0.3.977

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL