You can pass data to your components by using the props
property:
const panelResult = this.$showPanel({ component: "panel-2", props: { age: {{ age }} } });
And you can receive data from your panel by using the promise
property of the PanelResult
object:
const panelResult = this.$showPanel({ component: "panel-2", props: { age: {{ age }} } }); panelResult.promise .then(result => { //result is the value passed from your component calling this.$emit('close-panel', //some value); });
In your panel component you just need to call this.$emit('close-panel')
to close your panel:
//in your component's code ("panel-2" in this example) { props: { age: { type: String, required: true } }, data() { name : null }, methods: { closePanel() { this.$emit('closePanel', {}); } } }