Skip to content

Commit 1386cd9

Browse files
committed
add option to specify multiple methods in widgets
1 parent f94814b commit 1386cd9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type NumberWidget = {
2121
type: "number" | "value";
2222
text: string;
2323
method?: string;
24+
methods?: Array<string>;
2425
slots?: string | string[];
2526

2627
value: {
@@ -39,6 +40,7 @@ type SliderWidget = {
3940
type: "slider";
4041
text: string;
4142
method?: string;
43+
methods?: Array<string>;
4244
slots?: string | string[];
4345

4446
value: {
@@ -55,6 +57,7 @@ type SwitchWidget = {
5557
type: "switch";
5658
text: string;
5759
method?: string;
60+
methods?: Array<string>;
5861
slots?: string | string[];
5962

6063
value: {
@@ -219,6 +222,11 @@ export class ConfigClass {
219222
input_value = val;
220223
}
221224
}
225+
else if ("methods" in widget) {
226+
if (widget.methods?.includes(method_name)) {
227+
input_value = val;
228+
}
229+
}
222230
else {
223231
input_value = undefined;
224232
}

0 commit comments

Comments
 (0)