mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
fix: used generic typing
This commit is contained in:
@@ -30,8 +30,14 @@ import {
|
||||
|
||||
import WidgetLayoutField from './layout/WidgetLayoutField.vue'
|
||||
|
||||
interface BooleanWidgetOptions {
|
||||
on?: string
|
||||
off?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
const { widget } = defineProps<{
|
||||
widget: SimplifiedWidget<boolean>
|
||||
widget: SimplifiedWidget<boolean, BooleanWidgetOptions>
|
||||
}>()
|
||||
|
||||
const modelValue = defineModel<boolean>()
|
||||
@@ -41,7 +47,6 @@ const filteredProps = computed(() =>
|
||||
)
|
||||
|
||||
const currentLabel = computed(() => {
|
||||
const options = widget.options as { on?: string; off?: string }
|
||||
return modelValue.value ? options.on : options.off
|
||||
return modelValue.value ? widget.options?.on : widget.options?.off
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user