This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup lang="ts"> | |
import { ref, useSlots, getCurrentInstance } from "vue"; | |
const props = defineProps<{ url: string }>(); | |
const slots = useSlots(); | |
let res = ref(""); | |
let loading = ref(true); | |
fetch(props.url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts" setup> | |
import FetchJson from "./components/fetch-json.vue"; | |
// import { useFetch } from "@vueuse/core"; | |
const url = "https://api.thecatapi.com/v1/images/search"; | |
// const { isFetching: loading, error, data: response } = useFetch(url).json(); | |
</script> | |
<template> | |
<h3>Random Cat Pics!</h3> |