mirror of
https://github.com/tl-open-source/tl-rtc-file.git
synced 2025-11-01 02:52:35 +08:00
完善服务端接口调用测试用例
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
Home
|
<a-button @click="onClick">Home</a-button>
|
||||||
|
{{ test }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup>
|
||||||
|
const { data: test } = await useFetch('/api/test');
|
||||||
|
const onClick=async function(){
|
||||||
|
console.log(1);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
7
plugins/antd.ts
Normal file
7
plugins/antd.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Antd from 'ant-design-vue';
|
||||||
|
// import { Button } from 'ant-design-vue';
|
||||||
|
// import Button from 'ant-design-vue/lib/button'
|
||||||
|
export default defineNuxtPlugin((nuxtApp)=>{
|
||||||
|
nuxtApp.vueApp.use(Antd);
|
||||||
|
})
|
||||||
|
|
||||||
17
server/api/test.js
Normal file
17
server/api/test.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
export default defineEventHandler(() => {
|
||||||
|
return {
|
||||||
|
title: 'Mount Everest',
|
||||||
|
description: "Mount Everest is Earth's highest mountain above sea level, located in the Mahalangur Himal sub-range of the Himalayas. The China–Nepal border runs across its summit point",
|
||||||
|
height: '8,848 m',
|
||||||
|
countries: [
|
||||||
|
'China',
|
||||||
|
'Nepal'
|
||||||
|
],
|
||||||
|
continent: 'Asia',
|
||||||
|
image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Everest_kalapatthar.jpg/600px-Everest_kalapatthar.jpg',
|
||||||
|
dir: '/mountains',
|
||||||
|
path: '/mountains/mount-everest',
|
||||||
|
slug: 'mount-everest',
|
||||||
|
updatedAt: '2020-12-11T15:40:35.000Z'
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user