我在https://github.com/ericg-vue-questions/leaflet-test有一個 Vue 2 示例專案
宣告 divIcon時,我有:
const cloudIcon = L.divIcon({
html: thecloud,
className: 'my-custom-icons',
iconSize: [size, size],
iconAnchor: [size/2, size/2]
})
而且,為了讓傳單看到my-custom-icons
風格,我寫道:
<style scoped>
#mapContainer {
width: 500px;
height: 500px;
}
</style>
<style>
.my-custom-icons {
background-color: red;
}
</style>
我希望樣式部分看起來像:
<style scoped>
#mapContainer {
width: 500px;
height: 500px;
}
.my-custom-icons {
background-color: red;
}
</style>
但是當我放置my-custom-icons
在組件范圍部分內時, divIcon 找不到它。
我可以這樣組織我的風格部分嗎?如果是這樣,怎么做?
uj5u.com熱心網友回復:
您正在尋找DeepSelectors。
#mapContainer >>> .my-custom-icons {
background-color: red;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/498256.html
標籤:javascript css Vue.js Vuejs2 传单