Routable Panel events

Hi All,

this is a stupid question, but i cant seem to figure it out.

I’ve just installed a routable panel. my route looks like this:

{
path: “/side-panel/”,
panel: {
componentUrl: “./pages/side_panel.html”,
},
beforeEnter: checkAuth,
on: {
panelOpen: function () {
console.log(“side-panel init”);
},
pageBeforeRemove: function () {
console.log(“save settings”);
},
}
},

the checkauth does fire, as expected but I cant figure out what event to fire under the on: {} bit to trigger when the panel is loaded or ideally opened closed.

ive tried the following:

on: {
open: function () {
console.log(“side-panel init”);
},

on: {
panelClosed: function () {
console.log(“side-panel init”);
},

many thanks for replies - this forum is great!

Scott

Why do you handle events on route level if you use router component? Move it to panel component:

<template>
  <div class="panel ..." @panel:open="onOpen">
    ...
  </div>
</template>
<script>
  return {
    methods: {
      onOpen() {
        // console.log('open')
      }
    }
  }
</script>

Thanks that worked, but out of curiosity, is there a way to do that with an on: { } event?