0.1.22 • Published 6 years ago

vue-sails-promise v0.1.22

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

vue-sails-promise

Sails is the most popular MVC framework for Node.js. Vue-Sails-Promise is a plugin for Vue.js that integrates it with Sails.

NOTE: It's supposed to be compatible both with Vue 1.x and 2.x. It requires IE9+ or Safari 5+

Install

npm install vue-sails-promise

Usage

// Include and set up Sails client
const socketIOClient = require('socket.io-client');
const sailsIOClient = require('sails.io.js');
const io = sailsIOClient(socketIOClient);

// Additional Sails.io.js configuration
// io.sails.url = 'http://localhost:1337';
// io.sails.environment = process.env.NODE_ENV || 'development';

// Include vue-sails-promise as a CommonJS module
const Vue = require('vue');
const vueSails = require('vue-sails-promise');

// Enable the plugin globally
Vue.use(vueSails, io)

Now in every component you get a new property called $io, which allows you to interact with the Sails socket client:

this.$io.get(url, data).then(res => ...)

License

MIT

0.1.22

6 years ago

0.1.21

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago