title: Vue.js 3 - State Management - How to call a method from an ancestor
body: <p>I have a Vue 3 app. I'm using the Composition API as I've read it simplifies state management. As a result, I'm trying to to <em>avoid</em> using VueX. Perhaps, I've run into a scenario that warrants it. I currently have the following component structure in my app...</p>
  <p><strong>App</strong></p>
  <pre><code>+---------------------------------------------------+
  |                                                   |
  | +-----------------+    +--------------------+     |
  | | Component 1     |    | Component 2        |     |
  | | +-------------+ |    |                    |     |
  | | | Component A | |    +--------------------+     |
  | | +-------------+ |                               |
  | |                 |                               |
  | | +-------------+ |                               |
  | | | Component B | |                               |
  | | +-------------+ |                               |
  | +-----------------+                               |
  |                                                   |
  +---------------------------------------------------+
  </code></pre>
  <p>This whole app revolves around setting properties of a single <code>item</code>. The <code>item</code> can be initially set via <code>Component 1</code> or in <code>Component B</code>. You can set properties on the <code>item</code> via <code>Component A</code>. When a user clicks a button in <code>Component 2</code>, I want to force a method in <code>Component A</code> to run. However, I haven't figured out how to do that.</p>
  <p>Currently, in <code>Component 2</code> I use <code>this.$emit('forceRefresh')</code> when the button is clicked. However, <code>$emit</code> only let's me go up the stack. I'm not sure how to go down the stack once I've reached the top. I tried using a computed property in <code>Component A</code> however, that didn't work. I feel stuck, like I'm doing this wrong. Still, I know there's a way, I'm just unsure of what that way is.</p>