vue-ky-plugin

Simple a ky plugin for vue

Usage no npm install needed!

<script type="module">
  import vueKyPlugin from 'https://cdn.skypack.dev/vue-ky-plugin';
</script>

README

Ky Vue Plugin

Typescript vue ky plugin.

Based on ky package

This plugin simply extend the vue object with ky. It can also create a base instance to use directly from vue.

Install

npm install vue-ky-plugin --save

Import in Vue

In your entry set:

import Vue from 'vue';
import KyPlugin from './vue-ky-plugin';

Vue.use(KyPlugin);

// or 

import ky from 'ky';

Vue.use(KyPlugin,  ky.extend({prefixUrl: 'https://example.com/api'}))

How to use

In your components just do

  // just do
    (async () => {
        await this.$ky('unicorn', {prefixUrl: '/api'});
    })();

How ky works

Check ky github page

Know Issues

Other

andrewdev.eu