title: How to invoke some action on a component from the outside?
body: <p>I am building a simple feedback collection component for VuePress. I &quot;packaged&quot; it as a plugin, because that's the proper way to do that I suppose.
  The plugin is very simple and consists of:</p>
  <ul>
  <li><p><code>FeedbackCollector.vue</code> - a Vue component that displays a feedback button at the bottom of a page. When clicked, a panel appears with a few questions for the user</p>
  </li>
  <li><p><code>index.js</code>:</p>
  </li>
  </ul>
  <pre class="lang-js prettyprint-override"><code>const path = require('path')
  
  module.exports = {
      name: 'feedback-flyout',
      enhanceAppFiles: [
          path.resolve(__dirname, 'enhanceAppFile.js')
      ],
      globalUIComponents: 'FeedbackCollector'
  }
  </code></pre>
  <ul>
  <li><code>enhanceAppFile.js</code>:</li>
  </ul>
  <pre class="lang-js prettyprint-override"><code>import FeedbackCollector from './FeedbackCollector.vue'
  
  export default ({ Vue }) =&gt; {
    Vue.component('FeedbackCollector', FeedbackCollector)
  }
  </code></pre>
  <p>With this set of files, I have the basic functionality:  my component is displayed on every page of my VuePress site.
  Now, the thing is that I'd like to be able to open the feedback panel automatically sometimes, without the user clicking the button. I would add a method to my component <code>openPanel</code>. How do I invoke that method from the outside? That &quot;outside&quot; would probably be another JS file in my plugin that would check some cookies, and open the panel if the user has never seen that before.</p>
  <p>How to do that?</p>
  <ol>
  <li>How to add that new JS file to my plugin? I mean, how to make the code in this file run when my site loads? How to make it run whenever user navigates to a different document on my site?</li>
  <li>How to invoke the <code>openPanel</code> method that is defined in <code>FeedbackCollector.vue</code> from that new file?</li>
  </ol>
  <p>Or maybe there is some other better way to do that than what I proposed?
  Thanks for any help!</p>