我遇到一个问题,我在我的react应用程序中使用griddle.js和handsontable,我必须显示一个带有sup标签的值。但是输出是带有//something<sup>somthing</sup>
的平面文本,但是输出应该像sup tag
我的意思是html标签被视为平面文字。
任何建议将不胜感激。抱歉,我是Ractjs的初学者
const base_price = 100;
extProps.results = 'something' + base_price.sup(); //something + <sup>100</sup>
<Griddle
ref="griddle"
resultsPerPage={resultsPerPage}
table_value = { extProps.results}
/>
答案 0 :(得分:0)
您可以使用危险地使用SetInnerHTML呈现html元素
<style>
.append_div{
position: absolute;
top: 8%;
display: none;
background-color: pink;
border-right: 0px;
left: 0px;
padding: 30px;
display:none;
}
</style>
<body>
<div class="menu">
Hover Me
</div>
<div class="append_div">
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script>
$('.menu').hover(function(){
$(".append_div").show();
$(".append_div").css({"width":"170px","z-index":"1078"});
});
$( ".menu" ).mouseout(function() {
$(".append_div").hide('slow');
});
</script>
</body>