aggiunto e testato quasar apps

This commit is contained in:
fabio
2026-03-01 20:42:27 +01:00
parent cdcacadb5f
commit 66a3cc7cdb
73 changed files with 1559 additions and 389 deletions

View File

@@ -3,6 +3,10 @@
import { defineConfig } from '#q-app/wrappers';
import { fileURLToPath } from 'node:url';
import { resolve } from 'node:path';
import dotenv from 'dotenv';
dotenv.config({ path: resolve(__dirname, '../../.env') });
export default defineConfig((ctx) => {
return {
@@ -33,6 +37,9 @@ export default defineConfig((ctx) => {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-file#build
build: {
env: {
SITE_URL: process.env.SITE_URL || '',
},
target: {
browser: ['es2022', 'firefox115', 'chrome115', 'safari14'],
node: 'node20',

View File

@@ -1,37 +0,0 @@
<template>
<div>
<p>{{ title }}</p>
<ul>
<li v-for="todo in todos" :key="todo.id" @click="increment">
{{ todo.id }} - {{ todo.content }}
</li>
</ul>
<p>Count: {{ todoCount }} / {{ meta.totalCount }}</p>
<p>Active: {{ active ? 'yes' : 'no' }}</p>
<p>Clicks on todos: {{ clickCount }}</p>
</div>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue';
import type { Todo, Meta } from './models';
interface Props {
title: string;
todos?: Todo[];
meta: Meta;
active: boolean;
}
const props = withDefaults(defineProps<Props>(), {
todos: () => [],
});
const clickCount = ref(0);
function increment() {
clickCount.value += 1;
return clickCount.value;
}
const todoCount = computed(() => props.todos.length);
</script>

View File

@@ -1,8 +0,0 @@
export interface Todo {
id: number;
content: string;
}
export interface Meta {
totalCount: number;
}

View File

@@ -1,6 +1,7 @@
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string;
SITE_URL: string | undefined;
VUE_ROUTER_MODE: 'hash' | 'history' | 'abstract' | undefined;
VUE_ROUTER_BASE: string | undefined;
}

View File

@@ -13,8 +13,13 @@
<q-drawer v-model="leftDrawerOpen" show-if-above bordered>
<q-list>
<q-item-label header> List Items </q-item-label>
<q-item
clickable
tag="a"
:href="privateLink"
>
<q-item-section>Private</q-item-section>
</q-item>
</q-list>
</q-drawer>
@@ -28,6 +33,8 @@
import { ref } from 'vue';
const leftDrawerOpen = ref(false);
const siteUrl = (process.env.SITE_URL || '').replace(/\/+$/, '');
const privateLink = `${siteUrl}/private`;
function toggleLeftDrawer() {
leftDrawerOpen.value = !leftDrawerOpen.value;