📦 device/ nuxt-modules
Nuxt module for detecting device type.
Открыть на GitHub ↗обновлён 2нед назад
Звёзды
★ 1.0k
Форки
54
За неделю
1
За месяц
3
Рост %
0.1%
Язык
TypeScript
Установка и запуск
Installation
npx nuxt module add device
Usage
You can either use the useDevice() composable inside a script setup, or the $device helper directly in the template:
<template>
<div>
<div v-if="$device.isDesktop">Desktop</div>
<div v-else-if="$device.isTablet">Tablet</div>
<div v-else>Mobile</div>
</div>
</template>
<script setup>
const { isMobile } = useDevice()
</script>
Из README репозитория · полный README на GitHub
Теги
javascriptnuxtnuxtjs