✨ feat: Add input number element in setting-utils
This commit is contained in:
parent
50a2286d43
commit
c179519f95
2 changed files with 9 additions and 2 deletions
2
src/libs/index.d.ts
vendored
2
src/libs/index.d.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "slider" | "button";
|
||||
type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "number" | "slider" | "button";
|
||||
interface ISettingItem {
|
||||
key: string;
|
||||
value: any;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* @Author : frostime
|
||||
* @Date : 2023-09-16 18:05:00
|
||||
* @FilePath : /src/libs/setting-utils.ts
|
||||
* @LastEditTime : 2023-11-28 21:46:29
|
||||
* @LastEditTime : 2023-12-28 18:10:12
|
||||
* @Description : A utility for siyuan plugin settings
|
||||
*/
|
||||
|
||||
|
@ -130,6 +130,13 @@ export class SettingUtils {
|
|||
textareaElement.value = item.value;
|
||||
itemElement = textareaElement;
|
||||
break;
|
||||
case 'number':
|
||||
let numberElement: HTMLInputElement = document.createElement('input');
|
||||
numberElement.type = 'number';
|
||||
numberElement.className = 'b3-text-field fn__flex-center fn__size200';
|
||||
numberElement.value = item.value;
|
||||
itemElement = numberElement;
|
||||
break;
|
||||
case 'button':
|
||||
let buttonElement: HTMLButtonElement = document.createElement('button');
|
||||
buttonElement.className = "b3-button b3-button--outline fn__flex-center fn__size200";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue