- arr = [ 1, 2, 3, 4, 5, 6, 7, 8 ]
mixin xxx(arr, method, ...args)
- newArr = arr[method](...args)
p= newArr
+xxx(arr, 'slice', 2, 5)
+xxx(arr, 'filter', n => n & 1)
- arr = [ 1, 2, 3, 4, 5, 6, 7, 8 ]
mixin xxx(arr)
ul
each n in arr
li= n
+xxx(arr.slice(-3))
+xxx(arr.filter(n => !(n % 3)))
mixin item(item)
.inform-items__item(class=`inform-items__item_bg_${item.bg}`)
- let works = [
-
let works = [
li(class=list.class)= list.desc
li(class=item.class)= item.desc
each val, index in [ ... ]
li
a(class=index == 0 ? 'active' : '')
p test: {{ isNewDesign }}
mixin section(props)
-
var allMods = '';
if (typeof(props.mods) !== 'undefined' && props.mods) {
var modsList = props.mods.split(',');
for (var i = 0; i < modsList.length; i++) {
allMods = allMods + ' section--' + modsList[i].trim();
}
}
if props.bg && props.mods
section(class='section' + allMods style="background-image: url('https://source.unsplash.com/MYlCex1M7Ok/1920x200')")
.container
block
section(class='section' + allMods)
.container
block
если я пишу что то одно, то ошибка
- blocks.left()
-
if (blocks.left) {
blocks.left()
}
- blocks.left && blocks.left()
.