crea nueva lista
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
<template>
|
||||
<div class="full-height window-width row justify-center items-center">
|
||||
<q-infinite-scroll @load="onLoad" :offset="250">
|
||||
<div v-for="(lista, index) in arraylistas" :key="index" class="caption">
|
||||
<div v-for="(lista, index) in store.listas" :key="index" class="caption">
|
||||
<div class="q-pa-md row items-start q-gutter-md">
|
||||
<q-card class="my-card text-white"
|
||||
:class="store.user?.email === lista.email_owner ? 'bg-secondary' : 'bg-green-7'">
|
||||
<q-card-section>
|
||||
<q-badge color="orange" class="text-subtitle2" floating trasparent>{{ lista.items.filter(i =>
|
||||
!i.is_done).length
|
||||
}}/{{
|
||||
lista.items.length
|
||||
}}</q-badge>
|
||||
<q-badge color="orange" class="text-subtitle2" floating trasparent>
|
||||
{{ lista.items ? lista.items.filter(i => !i.is_done).length : '0' }}/{{ lista.items ?
|
||||
lista.items?.length : '0' }}
|
||||
</q-badge>
|
||||
<div class="text-h5">{{ lista.nombre }}</div>
|
||||
<div class="text-subtitle1">{{ lista.email_owner }}</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section>
|
||||
Compartido con:
|
||||
<span v-if="lista.profiles.length === 0">Nadie</span>
|
||||
<span v-if="!lista.profiles || lista.profiles.length === 0">Nadie</span>
|
||||
<span v-for="(profile, index) in lista.profiles" :key="index">
|
||||
{{ profile.email }}
|
||||
</span>
|
||||
@@ -51,7 +50,6 @@ const { supabase } = useSupabase()
|
||||
const $q = useQuasar()
|
||||
const store = supabaseStore()
|
||||
|
||||
let arraylistas = []
|
||||
|
||||
const getListas = async () => {
|
||||
try {
|
||||
@@ -60,7 +58,7 @@ const getListas = async () => {
|
||||
.select(`*, profiles(*),items(is_done)`)
|
||||
if (error) throw error
|
||||
console.log('listas', listas)
|
||||
arraylistas = listas
|
||||
store.listas = listas
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
$q.notify({
|
||||
@@ -73,7 +71,7 @@ const getListas = async () => {
|
||||
|
||||
const onLoad = (index, done) => {
|
||||
setTimeout(() => {
|
||||
arraylistas.push()
|
||||
store.listas.push()
|
||||
done()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user