How to use the vue-server-renderer/basic function in vue-server-renderer

To help you get started, we’ve selected a few vue-server-renderer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spatie / laravel-server-side-rendering-examples / resources / assets / js / vue / entry-server.js View on Github external
/* global context, dispatch */

import app from './app';
import renderVueComponentToString from 'vue-server-renderer/basic';

app.$router.push(context.url);

app.$store.commit('setPackages', { packages: context.packages });

renderVueComponentToString(app, (err, html) => {
    if (err) {
        throw new Error(err);
    }
    dispatch(html);
});