Nutritious Pancake Mountain

    @hubcarl/egg-view-vue

    1.0.0 • Public • Published

    egg-view-vue

    NPM version build status Test coverage David deps Known Vulnerabilities npm download

    egg view plugin for [vue].

    Install

    $ npm i @hubcarl/egg-view-vue --save

    Usage

    // {app_root}/config/plugin.js
    exports.vue = {
      enable: true,
      package: 'egg-view-vue',
    };

    Render in controller, support js bundle render and json bundle render (vue 2.3+)

    js bundle render

    // {app_root}/app/controller/test.js
    exports.home = function* (ctx) {
      yield ctx.render('vue-ssr-server-bundle.js', { name: 'vue js bundle render' });
    };

    json bundle render (vue 2.3+), need to config renderOptions

    // {app_root}/config/config.default.js
    exports.vue = {
       renderOptions: {
         template: '<!DOCTYPE html><html lang="en"><body><!--vue-ssr-outlet--></body></html>',
         clientManifest: require('vue-ssr-client-manifest.json')
       }
    };
    // {app_root}/app/controller/test.js
    exports.home = function* (ctx) {
      yield ctx.render('vue-ssr-server-bundle.json', { name: 'vue json render' });
    };

    Configuration

    see config/config.default.js for more detail.

    Questions & Suggestions

    Please open an issue here.

    License

    MIT

    Install

    npm i @hubcarl/egg-view-vue

    DownloadsWeekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • hubcarl