getlistas

This commit is contained in:
2025-02-07 12:33:21 +01:00
parent 6b2f9ff7db
commit 50a323609f
2 changed files with 49 additions and 15 deletions

View File

@@ -1,20 +1,54 @@
<template> <template>
<q-page> <div class="q-pa-md">
<div class="bg-light-green window-height window-width row justify-center items-center"> <q-infinite-scroll @load="onLoad" :offset="250">
<div class="column"> <div v-for="(lista, index) in arraylistas" :key="index" class="caption">
<div class="row"></div> {{ lista }}
<h1>Página principal</h1>
<h3 v-if="store.user">You are logged in as {{ store.user.email }}
</h3>
</div> </div>
<template v-slot:loading>
<div class="row justify-center q-my-md">
<q-spinner-dots color="primary" size="40px" />
</div>
</template>
</q-infinite-scroll>
</div> </div>
</q-page>
</template> </template>
<script setup> <script setup>
import { supabaseStore } from '../stores/supabaseStore' import useSupabase from '../boot/supabase'
//import useSupabase from '../boot/supabase' import { useQuasar } from 'quasar'
import { onMounted } from 'vue'
const store = supabaseStore() const { supabase } = useSupabase()
//const { supabase } = useSupabase() const $q = useQuasar()
let arraylistas = []
const getListas = async () => {
try {
let { data: listas, error } = await supabase
.from('listas')
.select(`*, profiles(*)`)
if (error) throw error
console.log('listas', listas)
arraylistas = listas
} catch (error) {
if (error instanceof Error) {
$q.notify({
type: 'negative',
message: error.message
})
}
}
}
const onLoad = (index, done) => {
setTimeout(() => {
arraylistas.push()
done()
}, 1000)
}
onMounted(() => {
getListas()
})
</script> </script>

View File

@@ -121,8 +121,8 @@ const { supabase } = useSupabase()
const store = supabaseStore() const store = supabaseStore()
const $q = useQuasar() const $q = useQuasar()
let email = ref('') let email = ref('melay74255@minduls.com')
let password = ref('') let password = ref('melay74255')
let repassword = ref('') let repassword = ref('')
let onLogin = ref(true) let onLogin = ref(true)
let isPwd = ref(true) let isPwd = ref(true)