Skip to content

Allow custom 'vuex bindings' to be displayed in ComponentInspector #845

Open
@jdoubleu

Description

@jdoubleu

What problem does this feature solve?

So far (computed) properties bound with mapState Vuex Component Binding Helper will be displayed as "vuex bindings" in the component inspector.
screenshot 2018-12-11 at 18 31 11

The helper exports a function with a property named vuex. In the devtools this property is checked for all computed properties (see here).

However, it is not possible to mark a (computed) property as "vuex bindings", if a custom userland wrapper (as supposed here) does not return a function.
This especially conflicts if the property has a computed setter and thereby is an object (see also).

This would make it possible to show another developer that a property is actually bound to the vuex state in one's app.

What does the proposed API look like?

The internal API only needs to check if the property is a "function" or an "object" in https://github.com/vuejs/vue-devtools/blob/dev/src/backend/index.js#L714.

One side-effect is that even in the component itself a property could be marked as "vuex binding". One could also want this, following the Form Two Way Binding example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions