autoconnect_callbacks_to_vue¶
- echo.vue.autoconnect_callbacks_to_vue(instance, widget, template=None, extras=None, only=None, skip=None, infer_properties_from='vue', prefix='')[source]¶
Connect callback properties on
instanceto traitlets onwidgetbidirectionally.- Parameters:
- instanceHasCallbackProperties
The state object with callback properties.
- widgetHasTraits
The ipyvuetify widget.
- infer_properties_from
'vue'or'python' How to discover which properties to connect:
'vue'(default): parse the Vue template to findv-model/:value.syncbindings and infer types from the Vue tags (e.g.v-switch→ bool,v-slider→ float). Useextrasfor properties the parser cannot discover.'python': discover all callback properties oninstanceand infer types from the property descriptors (ListCallbackProperty→ list,DictCallbackProperty→ dict,SelectionCallbackProperty→ selection, others → any).
- templatestr, optional
The Vue template string. Only used when
infer_properties_from='vue'. If not provided, the template is resolved from the widget’stemplate_fileclass attribute ortemplatetraitlet.- extrasdict, optional
Additional properties to connect that are not discovered automatically. Values can be:
A type string:
'bool','int','float','text','selection','list','dict', or'any'.A tuple of
(type, to_widget, from_widget)to supply custom transforms.
- onlyset or dict, optional
When provided, connect only the listed properties (skip automatic discovery). Can be a set of property names (types auto-inferred) or a dict with the same value format as
extras.- skipset, optional
Property names to skip (no warning, no connection).
- prefixstr, optional
A prefix to prepend to the widget traitlet names. For example, with
prefix='state_', a callback propertyx_minwill sync to a widget traitlet namedstate_x_min. When usinginfer_properties_from='vue', the template should reference the prefixed names (e.g.state_x_min).
- Returns:
- dict
Mapping of property names to connection handler objects.