如何将mix / else语句添加到mixin以将checked
属性添加到我的第一个无线电输入?
mixin tab-header(name, id)
input(type='radio' name='tabs' id=id checked)
label(for=id) name
+tab-header('Monday', 'toggle-monday')
+tab-header('Tuesday', 'toggle-tuesday')
+tab-header('Wednesday', 'toggle-wednesday')
+tab-header('Thursday', 'toggle-thursday')
答案 0 :(得分:1)
只需添加一个参数:
mixin tab-header(name, id, checked)
input(type='radio' name='tabs' id=id checked=checked)
label(for=id) name
+tab-header('Monday', 'toggle-monday', true)