Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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 answers
Answer question

0

You are looking for DeepSelectors.

#mapContainer >>> .my-custom-icons {
  background-color: red;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!