Javascript 传单弹出字符串html未使用react.js正确显示
我有以下代码尝试在弹出窗口中显示html:Javascript 传单弹出字符串html未使用react.js正确显示,javascript,html,string,reactjs,leaflet,Javascript,Html,String,Reactjs,Leaflet,我有以下代码尝试在弹出窗口中显示html: layer.bindPopup( `<p data data-campaign="4" data-token="${this.state.reg_mapping[feature.properties.name]}"> <h4>Region: ${feature.properties.name}</h4> <h4 data-token-re></h4> <button ty
layer.bindPopup(
`<p data data-campaign="4" data-token="${this.state.reg_mapping[feature.properties.name]}">
<h4>Region: ${feature.properties.name}</h4>
<h4 data-token-re></h4>
<button type="submit" data-button>Donate Now</button>
</p >`
);
layer.bind弹出窗口(
`
区域:${feature.properties.name}
现在捐赠
`
);
问题是我希望p标记是所有元素的父元素,但当我在inspector中时,我可以看到p标记关闭,因此不是其他元素的父元素。如何解决这个问题
编辑:我使用react.js
用
替换您的
。段落不能包含标题
标记。将
替换为
。段落不能包含标题
标记