@alitajs/vue-request
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

@alitajs/vue-request

定义 services

import { request } from 'valita';

export async function query(prames): Promise<any> {
  console.log(prames);
  return request('/hello');
}
<script setup>
import { useRequest , request } from 'valita';
import { query } from './services';
const { data, error, loading } = useRequest(query);
</script>

<template>
  <h1>Hi!</h1>
  <div v-if="loading">Loading</div>
  <div v-else>Hello {{ data.text }}</div>
</template>

感觉 import { useAsyncState } from '@vueuse/core'; 的用法更 vue ?

Readme

Keywords

none

Package Sidebar

Install

npm i @alitajs/vue-request

Weekly Downloads

0

Version

0.0.8

License

MIT

Unpacked Size

5.58 kB

Total Files

5

Last publish

Collaborators

  • pengyh
  • ashoka_j
  • diyc
  • xiaohuoni
  • imhele
  • wangxingkang
  • shawdanon
  • cjy0208
  • sorrycc
  • hang1017
  • hammersjs