feat: <Isolate />

This commit is contained in:
mini2024
2025-03-30 22:57:42 +08:00
parent 4b109a0829
commit 05d6a71da8
12 changed files with 103 additions and 12 deletions

View File

@@ -0,0 +1,27 @@
<script setup lang="ts">
const baseURL = '/fake-api';
let fakeApiResult = $ref<null | Record<string, unknown>>(null);
onMounted(() => {
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>