Files
vue-ts-example/src/pages/api.page.vue
严浩 1f2911c096
All checks were successful
/ depcheck (push) Successful in 2m38s
/ build-and-deploy-to-vercel (push) Successful in 2m21s
/ surge (push) Successful in 2m33s
/ playwright (push) Successful in 3m21s
feat: update ESLint configuration and package dependencies, add Ant Design Vue
2025-02-27 12:28:58 +08:00

26 lines
771 B
Vue

<script setup lang="ts">
const baseURL = '/fake-api';
let fakeApiResult = $ref<Record<string, unknown> | null>(null);
fetch(`${baseURL}/mock/get-user-info`)
.then((response) => response.json())
.then((json) => (fakeApiResult = json));
/* fetch('https://jsonplaceholder.typicode.com/posts/1')
.then((response) => response.json())
.then((json) => console.log(json)); */
// let npmRegistryApiResult = $ref<Record<string, any> | null>(null);
// fetch('/npm-registry-api/@vue%2Fbabel-plugin-jsx')
// .then((response) => response.json())
// .then((json) => npmRegistryApiResult = json);
</script>
<template>
<pre>{{ JSON.stringify(fakeApiResult, null, 2) }}</pre>
<!-- <div>{{ npmRegistryApiResult?.['_id'] }}</div> -->
</template>
<style scoped></style>