开发模板插件时有时需要一些配置项,当前的模板插件对于配置设置十分的不友好,只能手动想办法
现在只需要一个 json 就可以给模板插件添加新的设置页面了
项目地址: https://github.com/mohuishou/utools/tree/master/helper
如图所示

import { InitPlugins } from "./plugin";
import { Setting } from "./config/setting";
InitPlugins([
Setting.Init("utools-helper", [
{
name: "test",
type: "input",
label: "测试",
placeholder: "请输入测试配置",
default: "test",
},
{
name: "test2",
type: "input",
label: "测试2",
default: "这是我设置的默认值",
},
]),
]);
setTimeout(() => {
console.log(Setting.Get("test"));
console.log(Setting.Get("test2"));
}, 10000);