[Vuejs]-How to transfer data from an input field to another js file

2👍

Data that is shared between components should be owned by a module that provides an interface to the data item. The most common way this is done is that a parent component owns the data and children of that parent accept the data item as a prop, emitting events when the data item should change.

That is described in the documentation here.

If the components are less closely related, the data can be made more akin to a global variable by the use of an event bus, described here.

👤Roy J

Leave a comment