springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 14:04:16
73
我有一个web应用程序,前端使用HTML5,后端使用Django和MySQL。 某些列在MySQL中为NULL,它在HTML表中显示为“None”。
如何将HTML表中的所有无更改为空?
<table>
<tr>
<th>S/N</th>
<th>Course Material Title</th>
<th>Author/Editor</th>
<th>Publication Year</th>
<th>Edition</th>
<th>Special Edition</th>
<th>iSBN or e-iSBN / VBID</th>
<th>Cost</th>
<th>Material Format</th>
<th>Distribution Mode</th>
</tr>
{% for query_results_book in query_results_books_list %}
<tr>
<td>{{ forloop.counter }}</td>
{% for obj in query_results_book %}
{% if obj.title == "StudyGuide" or obj.title == "Mylab" %}
<td>{{ obj.title }}</td>
{% else %}
<td>{{obj.title}}</td>
{% endif %}
<td>{{obj.author}}</td>
<td>{{obj.pub_date}}</td>
<td>{{obj.edition}}</td>
<td>{{obj.special_edition}}</td>
{% if obj.Format_issued == "eText" %}
<td>{{ obj.vbid }}</td>
{% else %}
<td>{{ obj.isbn }}</td>
{% endif %}
{% if obj.e_price %}
<td>{{obj.e_price_cur}}{{obj.e_price}}</td>
{% else %}
<td></td>
{% endif %}
<td>{{obj.Format_issued}}</td>
<td>{{obj.Distribution_platform}}</td>
{%endfor%}
</tr>
{%endfor%}
</table>
mysql中的某些数据为null,在此HTML表中显示为“none”。Boss希望显示为空白。
顺晟科技:
是否可以在传递数据的地方尝试这样做,例如:
<table>
<tr>
<th>S/N</th>
<th>Course Material Title</th>
<th>Author/Editor</th>
<th>Publication Year</th>
<th>Edition</th>
<th>Special Edition</th>
<th>iSBN or e-iSBN / VBID</th>
<th>Cost</th>
<th>Material Format</th>
<th>Distribution Mode</th>
</tr>
{% for query_results_book in query_results_books_list %}
<tr>
<td>{{ forloop.counter }}</td>
{% for obj in query_results_book %}
{% if obj.title == "StudyGuide" or obj.title == "Mylab" %}
<td>{{ obj.title }}</td>
{% else %}
<td>{{obj.title}}</td>
{% endif %}
<td>{{obj.author}}</td>
<td>{{obj.pub_date}}</td>
<td>{{obj.edition}}</td>
<td>{{obj.special_edition}}</td>
{% if obj.Format_issued == "eText" %}
<td>{{ obj.vbid }}</td>
{% else %}
<td>{{ obj.isbn }}</td>
{% endif %}
{% if obj.e_price %}
<td>{{obj.e_price_cur}}{{obj.e_price}}</td>
{% else %}
<td></td>
{% endif %}
<td>{{obj.Format_issued}}</td>
<td>{{obj.Distribution_platform}}</td>
{%endfor%}
</tr>
{%endfor%}
</table>
所以,这将用空字符串/black替换所有nullish值
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11