我的苗条文件中有以下 if else 语句
- if x == 0
div Some cool title here
- else
div A different cool title goes here
这很好,但是我想在 div 中有一些子标签
- if x == 0
div Some cool title here
div Ditto
- else
div A different cool title goes here
div Ditto
这与 DRY 背道而驰。无论如何我可以减少这个代码,所以我不必两次看到子标签?到目前为止,我所做的任何尝试都导致我让子标签存在于一个 div 中而不是另一个 div 中,这不是我想要的,无论如何我都希望子标签存在。