Fix ref for watch

This commit is contained in:
René Preuß
2023-04-08 12:16:01 +02:00
parent 81b48ac806
commit 29915ebd3b
5 changed files with 124 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import {useAuth} from "#imports";
import {useAuth, useNuxtApp} from "#imports";
const {user, signOut} = await useAuth();
@@ -7,6 +7,15 @@ definePageMeta({
middleware: ["auth"]
})
const { $api } = useNuxtApp()
$api.get('users/@me')
.then((response: any) => {
console.log(response.data)
})
.catch((error: any) => {
console.log(error)
})
</script>
<template>