$q.platform.is.cordova
import { useQuasar } from 'quasar'
setup () {
const $q = useQuasar()
$q.platform.is.mobile
}
$q.platform.is.cordova
import { Platform } from 'quasar'
<script setup>
import { useRouter } from 'vue-router';
import { computed, watch } from 'vue';
import { useAuthStore } from '@/stores/auth'; // Пример с Pinia
const router = useRouter();
const authStore = useAuthStore();
const userRole = computed(() => authStore.role);
watch(userRole, (newRole) => {
if (newRole !== 'admin') {
router.push('/');
}
});
</script>
router.beforeEach((to, from, next) => {
const hasAccess = checkUserAccess(to);
if (!hasAccess) {
next('/');
} else {
next();
}
});
$.ajax({
url: '/ajax.php', // URL для обработки клика
type: 'POST',
data: {
action: 'increment_click', // Действие для обработки
notification_id: notificationDetails[i]['id'] // ID уведомления
},
success: function(response) {
console.log('Click counter updated.');
},
error: function() {
// Обработка ошибок, если нужно
console.log('Error updating click counter.');
}
});
if ($_POST['action'] == 'increment_click' && isset($_POST['notification_id'])) {
.....
логика обновления по инкрименту нотификатору
}
interface reqiestType = {
name?:string;
age?:number;
}
interface reqiestType {
name:string;
age:number;
}
const data:Partial<reqiestType> = {};