add hint type to settingUtil

This commit is contained in:
zxkmm 2024-01-13 22:07:41 +08:00
parent 74d62ac1aa
commit f84497f6da
6 changed files with 36 additions and 4 deletions

2
src/libs/index.d.ts vendored
View file

@ -1,4 +1,4 @@
type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "number" | "slider" | "button";
type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "number" | "slider" | "button" | "hint";
interface ISettingItem {
key: string;
value: any;

View file

@ -144,6 +144,11 @@ export class SettingUtils {
buttonElement.onclick = item.button?.callback ?? (() => {});
itemElement = buttonElement;
break;
case 'hint':
let hintElement: HTMLElement = document.createElement('div');
hintElement.className = 'b3-label fn__flex-center';
itemElement = hintElement;
break;
}
this.elements.set(item.key, itemElement);
this.plugin.setting.addItem({