<transition
v-on:before-enter="beforeEnter"
v-on:enter="enter"
v-on:after-enter="afterEnter"
v-on:enter-cancelled="enterCancelled"
v-on:before-leave="beforeLeave"
v-on:leave="leave"
v-on:after-leave="afterLeave"
v-on:leave-cancelled="leaveCancelled"
>
<!-- ... -->
</transition>
$fileName = 'goods.txt';
$startKey = '$$$REPLACEQUANTITYWITHOUTSALE';
$finishKey = '$$$REPLACEASPECTREMAINSWITHOUTSALE';
$fileContent = file_get_contents($fileName);
$startPosition = stripos($fileContent, $startKey) + strlen($startKey);
$fileGoods = explode(PHP_EOL, substr($fileContent, $startPosition, stripos($fileContent, $finishKey) - $startPosition));
const collections = []
for (let i = 0; i < data.length; i++) {
if (!collections.includes(data[i].collection)) {
collections.push(data[i].collection);
}
}
const collections = Array.from(new Set(data.map(d => d.collection)));
const collections = Object.keys(data.reduce((res, next) => {
res[next.collection] = null;
return res;
}, {}));
const collections = data.reduce((res, next) => {
if (!res.includes(next.collection)) {
res.push(next.collection);
}
return res;
}, {});
var json = [{'id':1, 'name':'John', 'collection':'boston'},
{'id':2, 'name':'Faer', 'collection':'antler'},
{'id':3, 'name':'klei', 'collection':'aqua'},
{'id':4, 'name':'Inda', 'collection':'boston'},
{'id':5, 'name':'Faer', 'collection':'antler'}];
var result = new Set();
for (var i = 0; i < json.length; i++) {
result.add(json[i].collection);
}
console.log(result);
START TRANSACTION;
select * from users where id = 54 FOR UPDATE
//проверка бизнес логики на наличие денег
update `users` set `balance` = `balance` - 150 where `id` = 54;
COMMIT;
const grouped = data
.reduce((acc, n, i, a) => {
if (i && n.id === a[i - 1].id + 1) {
acc[acc.length - 1][1][1] = n.id;
} else {
acc.push([ [], [ n.id ] ]);
}
acc[acc.length - 1][0].push(n);
return acc;
}, [])
.reduce((acc, n) => {
acc[n[1].join('-')] = n[0];
return acc;
}, {});
<?php if ($test == 1): ?>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<?php endif ?>
<?php if ($test == 1) {
echo "<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>
<div>some text</div>";
}
?>