将 if/else 语句添加到 Pug(ex-Jade)mixins?
Adding if/else statements to Pug (ex-Jade) mixins?
如何将 if/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')
再添加一个参数:
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)
如何将 if/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')
再添加一个参数:
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)