请注意src/components/ApiGet.vue组件,此组件可用于get相关的网络请求。
此组件封装了一些默认的loading效果、错误处理内容提示。
相关使用示例:
<template>
<ApiGet :url="url">
<template v-slot="slotProps">
<div class="result">{{ slotProps.data[0].id }}</div>
</template>
</ApiGet>
</template>
<script setup>
import ApiGet from './ApiGet.vue';
/**
* 使用默认的Loading、错误处理组件
* 使用 slot 数据
*/
const url = '/api/agent/list';
</script>