Skip to content

Instantly share code, notes, and snippets.

View idesignzone's full-sized avatar

Ali Seivani idesignzone

View GitHub Profile
@idesignzone
idesignzone / nuxt-traccar-login.vue
Created March 9, 2024 11:08
Nuxt 3 - Traccar login script
<template>
</template>
<script setup>
const config = useRuntimeConfig();
const credentials = reactive({
email: undefined,
password: undefined,
@idesignzone
idesignzone / form-repeater.vue
Created January 10, 2024 19:23
Form repeater Nuxt - Vue
<template>
<div class="mt-2">
<template v-for="field in fields" :key="field.id">
<div class="flex items-center gap-1 mb-1">
<div class="w-full">
<UInput
v-model="field.content"
type="text"
size="md"
variant="outline"
@idesignzone
idesignzone / nuxt-ui-i18n-language-switcher.vue
Created January 10, 2024 14:31
Nuxt UI i18n language switcher
<template>
<USelectMenu
v-model="$i18n.locale"
:options="availableLocales"
variant="none"
size="md"
:popper="{ arrow: false }"
:ui="{ option: { container: 'flex items-center gap-2 min-w-max' } }">
<template #leading>
<UIcon name="i-heroicons-language" class="w-5 h-5" />
@idesignzone
idesignzone / Headless-UI-Switch-reusable-component-Vue-Nuxt.vue
Last active January 3, 2024 21:53
Headless UI Switch reusable component for Vue and Nuxt
<template>
<SwitchGroup as="div" class="flex items-center">
<Switch
:modelValue="modelValue"
@update:modelValue="(newValue) => $emit('update:modelValue', newValue)"
:class="[
modelValue ? 'bg-indigo-500' : 'bg-gray-200 dark:bg-gray-800',
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-none',
]">
<span
@idesignzone
idesignzone / cordova-plugin-purchase-vue3-composable.js
Last active January 10, 2024 14:32
cordova-plugin-purchase vue3 composable
import { ref } from "vue";
import { Capacitor } from "@capacitor/core";
import "cordova-plugin-purchase/www/store";
export function useInAppPurchase() {
const iapProduct = ref();
const iapOrder = ref();
if (Capacitor.isNativePlatform()) {
const { store, ProductType, Platform } = CdvPurchase;