Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 传单弹出字符串html未使用react.js正确显示_Javascript_Html_String_Reactjs_Leaflet - Fatal编程技术网

Javascript 传单弹出字符串html未使用react.js正确显示

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

我有以下代码尝试在弹出窗口中显示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 type="submit" data-button>Donate Now</button>
</p >`
);
layer.bind弹出窗口(
`

区域:${feature.properties.name} 现在捐赠

` );
问题是我希望p标记是所有元素的父元素,但当我在inspector中时,我可以看到p标记关闭,因此不是其他元素的父元素。如何解决这个问题

编辑:我使用react.js


替换您的
。段落不能包含标题
标记。

替换为
。段落不能包含标题
标记