@ricvillagrana/actioncable-vue
v0.1.0
Published
ActionCableVue is a component that allows you to connect your frontend with Rails websockets.
Downloads
6
Readme
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.