first commit
This commit is contained in:
38
src/pages/IndexPage.vue
Normal file
38
src/pages/IndexPage.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<q-page class="flex flex-center">
|
||||
<h3>{{ resultList }}</h3>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import PocketBase from "pocketbase";
|
||||
import { ref } from "vue";
|
||||
|
||||
const resultList = ref("");
|
||||
|
||||
const pb = new PocketBase("https://pocketbase.clonbg.es");
|
||||
const authData = pb
|
||||
.collection("users")
|
||||
.authWithPassword("diloma", "dilomadiloma");
|
||||
|
||||
// after the above you can also access the auth data from the authStore
|
||||
console.log(pb.authStore.isValid);
|
||||
console.log(pb.authStore.token);
|
||||
console.log(pb.authStore.model.id);
|
||||
// console.log(authData);
|
||||
|
||||
pb.collection("lista")
|
||||
.getList(1, 50)
|
||||
.then((result) => {
|
||||
// success...
|
||||
console.log("Result:", result);
|
||||
resultList.value = result;
|
||||
})
|
||||
.catch((error) => {
|
||||
// error...
|
||||
console.log("Error:", error);
|
||||
});
|
||||
|
||||
// "logout" the last authenticated account
|
||||
//pb.authStore.clear();
|
||||
</script>
|
||||
Reference in New Issue
Block a user