schlunsen/nuxt-leaflet

Unknown custom element: <l-control>

richeduni opened this issue · 2 comments

Hi,

Firstly, love this plugin. Everything else is working perfectly, however, I am trying to use an l-control element and get the following error message:

Unknown custom element: <l-control> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

My template looks like:

<template>
  <div v-if="locationsLoaded">
     <div id="map-wrap" style="height: 100vh">
         <no-ssr>
           <l-map :zoom=12.75 :center="[55.953251, -3.188267]">
             <l-tile-layer url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"></l-tile-layer>
              <l-control position="bottomleft" >
                  <button @click="goHome">
                    I am a useless button!
                  </button>
              </l-control>
             <l-marker v-for="(location, index) in locations"
                
                :key="index"
                ref="markersRef"
                :lat-lng="[location.latitude, location.longitude]"
              >
                    <l-popup>
                        {{location.location}}<br>
                        PCs available: {{location.free}}<br> 
                        Total PCs: {{location.seats}}
                    </l-popup> 
              </l-marker>
           </l-map>
         </no-ssr>
     </div>
  </div>
  <div v-else>
    <p> Loading map ...</p>
  </div>
</template> 

Thanks in advance for your help.

Hi, I just updated the project. Please use the latest version and let me know if you still have problems.

Yes, it's working now. Thank you very much for fixing this. Very much appreciated