• Home
  • Vuejs
  • Vue.js refs are undefined, even though this.$refs shows correctly

Vue.js refs are undefined, even though this.$refs shows correctly

linkaiyi
Follow

In case that this.$refs shows undefined in vuejs application, use v-show instead of v-if solves the problem:

use the following

<div v-show="!isLoading"> 
   <GMap ref="mapRef" />
 </div>

instead of

<div v-if="!isLoading"> 
   <GMap ref="mapRef" />
 </div>
Object has 0 attachments

Was this article helpful?

This article is viewed 63 times!

0 Comments

Leave a Comment

Support