npm install vue2-slideout-panel --save-dev
1) Install the Vue Slideout Panel plugin:
import Vue from 'vue'; import VueSlideoutPanel from 'vue2-slideout-panel'; Vue.use(VueSlideoutPanel);
2) In your HTML add the component:
<slideout-panel></slideout-panel>
3) Launch a panel from your component:
methods: { showPanel() { const panel1Handle = this.$showPanel({ component : 'your-component-name', props: { //any data you want passed to your component } }) panel1Handle.promise .then(result => { }); } }
'your-component-name'
just needs to be the name of a valid component that you have registered with Vue like this:
Vue.component('your-component-name', {})
The $showPanel()
method returns a PanelResult
object.
PanelResult
object here.