ubuntu下的
pycharm 在 template 里塊注釋(快捷鍵 ctrl+/
):
<!-- <p class="js-header" name="n">名稱</p>
<p class="js-header" name="pn">商品編號(hào)</p>
<p class="js-header" name="b">品牌</p>
<p class="js-header" name="s">系列</p>
<p class="js-header" name="d">上傳日期</p>-->
實(shí)際上是無效的。
正確注釋 template 內(nèi)塊代碼的標(biāo)志為:
{# <p class="category-title">#}
{# 分類修改記錄#}
{# </p>#}
這才是django的塊代碼注釋方式,
不知在哪里設(shè)置該快捷鍵?
學(xué)習(xí)是最好的投資!
Thanks to the comment area @永中 who can’t learn programming
The community version does not have this function, and it has nothing to do with the platform.
Sure enough, this situation only occurs in the community version.
1) First select the block to be commented, then Ctrl + Shift + "/"
2) Select any line of the block to be commented, Ctrl + "-" to fold the code into one line, then Ctrl + "/" to comment
Django template allows the same comments as python, the commented out html will not be output to the client
Line comment, cursor to the current line ctrl+/
Block comment, select the block to be commented ctrl+shift+/