# theme-js **Repository Path**: lwj1426282929/theme-js ## Basic Information - **Project Name**: theme-js - **Description**: 一款设置前端界面主题的js - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-02-28 - **Last Updated**: 2023-03-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # theme-js #### 设置主题 #### 安装 ##### npm ```bash npm i @lwjjs/theme ``` ##### browser ```js ``` #### 使用 ```js import Theme from "@lwjjs/theme"; new Theme(); ``` #### 自定义主题配置项 在初始化阶段可以通过传入参数来配置主题唯一标识 ```js new Theme({ name: "themeName", code: "themeCode" }); ``` #### Methods | 方法名 | 说明 | 参数 | 返回值 | | ----------- | ------------------ | --------- | -------- | | getTheme | 获取当前主题 | - | 当前主题 | | setTheme | 设置主题为当前主题 | theme | - | | setThemes | 设置所有主题列表 | themes | - | | addTheme | 添加主题 | theme | - | | removeTheme | 删除主题 | themeCode | - |