Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
Can I have the className of a leaflet divIcon inside the <style scoped> section of a vue component?

I have a Vue 2 sample project at https://github.com/ericg-vue-questions/leaflet-test

When declaring the divIcon, I have:

      const cloudIcon = L.divIcon({
        html: thecloud,
        className: 'my-custom-icons',
        iconSize: [size, size],
        iconAnchor: [size/2, size/2]
      })

and, for leaflet to see the my-custom-icons style, I wrote:

<style scoped>
  #mapContainer {
    width: 500px;
    height: 500px;
  }
</style>

<style>
  .my-custom-icons {
    background-color: red;
  }
</style>

I would like the style section to look like:

<style scoped>
  #mapContainer {
    width: 500px;
    height: 500px;
  }

  .my-custom-icons {
    background-color: red;
  }
</style>

But when I place my-custom-icons inside of the components scoped section, the divIcon cannot find it.

Can I organize my style section like this? If so, how?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are looking for DeepSelectors.

#mapContainer >>> .my-custom-icons {
  background-color: red;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda