0.1.0 • Published 5 years ago

@ricvillagrana/actioncable-vue v0.1.0

Weekly downloads
2
License
-
Repository
-
Last release
5 years ago

ActionCableVue

ActionCableVue is a component that allows you to connect your frontend with Rails websockets.

Installing

yarn add actioncable-vue # or npm i actioncable-vue

Importing

import ActionCableVue from 'actioncable-vue'

Vue.component('action-cable-vue', ActionCableVue)

The component

<ation-cable-vue
  :channel="MyChannel"
  :room="MyRoom"
  @initialized="onInitialized"
  @connected="onConnected"
  @disconnected="onDisconnected"
  @rejected="onRejected"
  @received="onRecieved"
  >

Props and v-on event listerners

You need to specify two basic properties:

  props: {
    channel: String,
    room: String
  }

After this you use all events form actioncable.

0.1.0

5 years ago