transition-group
. Вот так всё просто. export function indexToFind () {...}
import { indexToFind } from 'utils.js';
import axios from 'axios';
Vue.prototype.$http = axios;
var myForm = document.getElementById("myForm");
myForm.addEventListener('submit', function(event){
//какой то код
if(условие отмены отправки){
event.preventDefault();
return false;
}
});
store() {
// Создайте новый объект для передачи на сервер
const formattedTranslations = {};
// Пройдитесь по всем локалям и создайте нужную структуру данных
for (const locale of this.locales) {
formattedTranslations[locale] = {
title: this.translations.title[locale],
desc: this.translations.desc[locale],
};
}
console.log(formattedTranslations);
// Отправьте данные на сервер
this.$inertia.post(route('post.store'), { translations: formattedTranslations });
}
$('.scroll_link').on('click', function(e){
e.preventDefault();
let href = $(this).attr('href');
let page = window.location.search.replace('?page=', '') || '1'; // получаем текущий номер страницы из URL
let newHref = href.replace('?page=', `?page=${page}&`); // заменяем номер страницы на текущий
window.location.href = newHref; // переходим на новую страницу
});
SELECT categories.id,
categories.slug,
ct_ru.title title_ru,
ct_en.title title_en,
ct_de.title title_de
FROM categories
LEFT JOIN category_translations ct_ru ON category_translations.category_id=categories.id
AND category_translations.locale = 'ru'
LEFT JOIN category_translations ct_en ON category_translations.category_id=categories.id
AND category_translations.locale = 'en'
LEFT JOIN category_translations ct_de ON category_translations.category_id=categories.id
AND category_translations.locale = 'de';
UPDATE table
SET {columns} = {values}
ORDER BY created_at ASC LIMIT 1;
update event, (select id from event order by date limit 1) as s set value = 'changed', date = now() where t.id = s.id;