New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vue-ws

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-ws

Vue-socket is a websocket plugin for Vue.js.

latest
npmnpm
Version
0.0.2-beta
Version published
Maintainers
1
Created
Source

Vue-Socket

Introduction

Vue-socket is a websocket plugin for Vue.js. It inject websocket lifecycle events into components, like open, close, error, and also it simplify event binding of message event. Support for Typescript.

Warning

The data structure of message event's data property should be like {type: "ping", data: {}}.

Install

npm install vue-ws

Usage

entry file

import VueSocket from "vue-ws";
Vue.use(VueSocket);

component

import Vue from "vue";
export default Vue.extend({
    onWebSocketOpen(){
        console.log("opened");
    },
    onWebSocketMsg: {
        ping(){
            console.log("pong");
        }
    }
});

License

This package is published under MIT license.

Keywords

vue

FAQs

Package last updated on 17 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts