在OpenLayers 3中可以更改选区中的边框颜色:
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
width: 2
})
});
Run Code Online (Sandbox Code Playgroud)
但是有可能只改变边界底部吗?
就像是:
style = new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'blue',
width: 2,
border-bottom: 2px dotted #ff9900
})
});
Run Code Online (Sandbox Code Playgroud) 我需要获取对 svelte 中每个循环内创建的每个 div 的引用,然后当用户单击前一个 div 时,我将使用该引用来切换特定 div 的 css 类。
let contentOptions;
function handleClick(event) {
contentOptions.classList.toggle("close");
}
{#each items as item, i}
<div class="titleOption" on:click={handleClick}>
<img src="./assets/{item.icon}"/>
<span>{item.label}</span>
</div>
<div class="content close" bind:this={contentOptions}>Content Option {i}</div>
{/each}
Run Code Online (Sandbox Code Playgroud)
Items 数组具有三个对象,尽管单击另一个 div,但它始终显示最后一个带有文本“Content Option 2”的 div。
可以单独绑定每个div吗?
React-leaflet 包允许使用 leaflet 并使用功能组件进行反应,至少https://react-leaflet.js.org/上的所有示例都使用功能组件。是否可以在 React-leaflet 版本 3 中使用类组件?如果是的话,有例子吗?