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 instance to traitlets on widget bidirectionally.

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 find v-model / :value.sync bindings and infer types from the Vue tags (e.g. v-switch → bool, v-slider → float). Use extras for properties the parser cannot discover.

  • 'python': discover all callback properties on instance and 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’s template_file class attribute or template traitlet.

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 property x_min will sync to a widget traitlet named state_x_min. When using infer_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.