title: How to get Parent Element from json object using Vue
body: <p>I have some flattened out json data that I am working with and I'm having trouble accessing parts of it, so I'm hoping to use the elements I can access, then get their parent elements for display. I need to get the count of any arrays with multiple values and just display the value if there's only one, which I can do. Where I'm running into the issue is trying to display the parent(maybe not the best term?) value of the array.</p>
  
  <p>For Example, if this is my json data:</p>
  
  <pre><code>{
    "Dogs": [
        {   
            "Name": "Gus",
            "Leashes": {
                "564": [
                    6
                ]
            }
  
        },
        {   
            "Name": "Jake",
            "Leashes": {
                "15775": [
                    "457",
                    "787",
                    "278"     
                ]
            }
        },
    ]
  }
  </code></pre>
  
  <p>What can I do to access the "564" and "15775" values so I can display them in the left column of a table? I know the data is bad and should be standardized with an ID or something there, but it isn't, and there's nothing I can do about that until they fix their transform and get the data corrected. In this example, to get the length or to just display the data I need can use something like this (Please ignore the spans, this data will go in a table):</p>
  
  <pre><code>&lt;template v-for="Dog in Dogs"&gt;
      &lt;template v-for="Leash in Dog.Leashes"&gt;
          &lt;span v-if="Leash.length &lt;= '1'"&gt;{{ Leash[0] }}&lt;/span&gt; (Gives me 
          the values which is good)
          &lt;span v-if="Leash.length &gt; '1'"&gt;{{ Leash.length }}&lt;/span&gt; (Gives 
          me the count, also good)
      &lt;/template&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>Where I am stuck is trying to get those parent values to display. I'm using a table and need the parent "IDs" for the left column and the values (which I can get) for the right column. Any help would be greatly appreciated. Trying to use a function or a vue instance for the data is slightly out of the question at the moment. I saw some complicated examples on how to do this, and I wasn't able to get them to work. is there something like the following:</p>
  
  <pre><code>&lt;template v-for="Dog in Dogs"&gt;
      &lt;template v-for="Leash in Dog.Leashes"&gt;
          &lt;span&gt;{{ Leash.parent }}&lt;/span&gt;
      &lt;/template&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>Using {{ Leash }} gives me the arrays.</p>
  
  <p>Any help would be tremendously appreciated here. I'll have to redo some of this once they actually get the data right, but for now, this is sort of what I'm working with.</p>