0.0.2 • Published 8 months ago

csrq v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

csrq

Description

CheShine ReQuset is a library to handle network request for Vue.

Support for axios and fetch (will).

usage

Install csrq as:

npm install csrq --save

You can use it as:

import { createApp } from "vue";
import App from "./App.vue";
import { requestPlugin } from "csrq";

createApp(App).use(requestPlugin, {}).mount("#app");

and then you can have it in components by hooks:

<script setup lang="ts">
import { useRequest } from "csrq";
import { onMounted } from "vue";

onMounted(() => {
  const req = useRequest();
  const url = "api/1";
  const params = { param1: "value1", param2: "value2" };
  const api1 = req.createGetRequestExecutor(url, params);
  console.log(api1);
});
</script>
0.0.2

8 months ago

0.0.1

1 year ago