gpt4 book ai didi

html - Thymeleaf 中的算术运算

转载 作者:太空狗 更新时间:2023-10-29 16:51:07 24 4
gpt4 key购买 nike

如何在 thymeleaf 中进行一些算术运算。我测试了很多方法。但无法获得输出。如果你知道,请告诉我。

这是我的代码:

/*Dummy Content */ 
<p class="quan-inc-dec">
<input type="hidden" name="productId" th:value="*{product.id}" class="productId"/>
<input type="hidden" name="orderItemId" th:value="*{id}" class="orderItemId"/>
<input type="button" name="minus" class="minus" value="-" autocomplete="off"/>
<input type="text" name="quantity" value="1" class="result" autocomplete="off" th:value="*{quantity}"/>
<input type="button" name="plus" class="plus" autocomplete="off" value="+"/>
</p>
/*Dummy Content End*/
<span th:text="${${obj.baseRetailPrice}*${obj.aa}}"><!-- I need the Result Here --></span>

最佳答案

像这样:

<div th:with="result=${obj.baseRetailPrice * obj.aa}">
<span th:text="${result}"></span>
</div>

关于html - Thymeleaf 中的算术运算,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21775217/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com