vue-ky-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i vue-ky-plugin

Weekly Downloads

5

Version

1.0.4

License

MIT

Unpacked Size

3.6 kB

Total Files

5

Last publish

Collaborators

  • andreabbondanza