Load Component Dynamically
To load component based on user device, you can use isDesktop or isMobile from stores/clientType
import useClientTypeStore from "~/stores/clientType";
import { storeToRefs } from "pinia";
const clientTypeStore = useClientTypeStore();
const { isDesktop, isMobile } = storeToRefs(clientTypeStore);
const myButton = defineAsyncComponent(() =>
import("./components/MyButton.vue")
);
then can use in <template>
<template>
<div>
<template v-if="isDesktop">
<component :is="myButton"></component>
</template>
</div>
</template>