The@json
directive is also useful for seeding Vue components or data-* attributes:
<example-component :some-prop='@json($array)'></example-component>
Using@json
in element attributes requires that it be surrounded by single quotes.
....
axios.get("/info/car").then(result => {
this.cars = result.data; /* 1. Получили данные от сервера и записали в переменную. */
this.$nextTick(function() {
$(".selectpicker").selectpicker(); /* 3. Иногда не успевает дождаться рендеринга и
в select не отображает элементы, ибо vue.js их еще не создал. */
});
});
....
select * from course where
course.created_at = (select created_at from course as dates where dates.currency = course.currency order by created_at desc limit 1)
CREATE INDEX age ON course(currency, created_at desc);
drop: e => {
надо drop(e) {
$(document).on('click', '.show-text', function() {
$('.seo-text').toggleClass('hide-before');
});
let showLink = document.querySelector('.show-text');
if (showLink)
showLink.addEventListener('click', () => {
let text = document.querySelector('.seo-text');
if (text)
text.classList.toggle('hide-before');
});
document.querySelectorAll('.show-text').forEach(node => {
node.addEventListener('click', () => {
document.querySelectorAll('.seo-text').forEach(node => {
node.classList.toggle('hide-before');
});
});
});
public function children()
{
return $this->hasMany(self::class, 'parent_id');
}
public function parent()
{
return $this->belongsTo(self::class);
}