mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-26 09:44:06 +00:00
* feat: widget input text style * feat: widget select button style * feat: the selection style of LGraphNode * feat(V3 UI style): color picker + file upload + input text + multi select + select + select button + slider + textarea + tree select * feat: placeholder * fix: filter multi select options * fix: direct binding, no transform for select button widget
37 lines
913 B
Vue
37 lines
913 B
Vue
<template>
|
|
<WidgetLayoutField :widget="widget">
|
|
<FormSelectButton
|
|
v-model="localValue"
|
|
:options="widget.options?.values || []"
|
|
:disabled="readonly"
|
|
class="w-full"
|
|
@update:model-value="onChange"
|
|
/>
|
|
</WidgetLayoutField>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useStringWidgetValue } from '@/composables/graph/useWidgetValue'
|
|
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
|
|
|
|
import FormSelectButton from './form/FormSelectButton.vue'
|
|
import WidgetLayoutField from './layout/WidgetLayoutField.vue'
|
|
|
|
const props = defineProps<{
|
|
widget: SimplifiedWidget<string>
|
|
modelValue: string
|
|
readonly?: boolean
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
'update:modelValue': [value: string]
|
|
}>()
|
|
|
|
// Use the composable for consistent widget value handling
|
|
const { localValue, onChange } = useStringWidgetValue(
|
|
props.widget,
|
|
props.modelValue,
|
|
emit
|
|
)
|
|
</script>
|