“Kabel akcji nuxtjs” Kod odpowiedzi

Kabel akcji nuxtjs

// nuxt.config.js
/*
 ** Plugins to load before mounting the App
 */
plugins: [{ src: '@/plugins/actioncable-vue', ssr: false }];
Homeless Hedgehog

Kabel akcji nuxtjs

import store from './store';
import Vue from 'vue';
import ActionCableVue from 'actioncable-vue';

Vue.use(ActionCableVue, {
  debug: true,
  debugLevel: 'all',
  connectionUrl: process.env.WEBSOCKET_HOST,
  connectImmediately: true,
  store
});
Homeless Hedgehog

Kabel akcji nuxtjs

// /plugins/actioncable-vue.js

import Vue from 'vue';
import ActionCableVue from 'actioncable-vue';

if (process.client) {
  Vue.use(ActionCableVue, {
    debug: true,
    debugLevel: 'all',
    connectionUrl: process.env.WEBSOCKET_HOST,
    connectImmediately: true
  });
}
Homeless Hedgehog

Odpowiedzi podobne do “Kabel akcji nuxtjs”

Pytania podobne do “Kabel akcji nuxtjs”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu