Unable to create ref dynamically in Vue.js

Viewed 1555

I am rendering a list and then a sublist within that. I want to have a ref to my inner list which will be named something like list-{id}. However, I am not able to achieve this.

Here is the code snippet:

<ul class="scrollable-list" ref="getScrollableRef(company.id)">
  <li v-for="operation in getOperations(company.id)">
    {{company.name}}
  </li>
</ul>

When I inspect the $refs object:

$vm0.$refs
Object {getScrollableRef(company.id): Array(13)}

I think for some reason the value is not being evaluated. Has anyone faced this?

Edit: I am trying to solve this problem https://github.com/egoist/vue-mugen-scroll/issues/14

1 Answers
Related