HerringtonDarkholme / av-ts

A modern, type-safe, idiomatic Vue binding library
MIT License
216 stars 11 forks source link

ref undefined #48

Closed Jacknq closed 7 years ago

Jacknq commented 7 years ago
  <div ref="title"   class="col-6">
                        {{ new Date(rec.DateCreated)| <a href=""> author</a>
                      </div>
..
// $refs: {
//     title: HTMLDivElement
//   }
  @Lifecycle mounted() { 
     this.getData(); 
     alert(this.$refs["title"] );
  //this.$refs.title
     } 

gets undefined, but why?

Jacknq commented 7 years ago

sorry, it was inside v-if, data came afterwards, it didnt existed yet.