2.4.0 • Published 3 years ago

vue-pronto v2.4.0

Weekly downloads
484
License
ISC
Repository
github
Last release
3 years ago

vue-pronto

NPM version Build Status Dependency Status Coverage percentage Greenkeeper badge Codacy Badge

Rendering Engine for turning Vue files into Javascript Objects

Installation

$ npm install --save vue-pronto

Usage

Include the library at the top level like so

const Pronto = require('vue-pronto');

Then init the renderer

const renderer = new Pronto({object});

This returns 2 main functions. It takes 3 params, 2 required and one optional.

renderer.RenderToString(componentPath, data, [vueOptions]);
renderer.RenderToStream(componentPath, data, [vueOptions]);

Both methods return a promise. Stream returns a stream, and String returns a string.

RenderToStream

renderer.RenderToStream(vuefile, data, vueOptions) ⇒ Promise

renderToStream returns a stream from res.renderVue to the client

Kind: instance method of Renderer Returns: Promise - - Promise returns a Stream

ParamTypeDescription
vuefilestringfull path to .vue component
dataObjectdata to be inserted when generating vue class
vueOptionsObjectvue options to be used when generating head

RenderToString

renderer.RenderToString(vuefile, data, vueOptions) ⇒ Promise

renderToStream returns a string from res.renderVue to the client

Kind: instance method of Renderer

ParamType
vuefilestring
dataobject
vueOptionsobject

VueOptions

{
    pagesPath: path.join(__dirname, '/../tests'),
    vueVersion: "2.3.4",
    template: {
        body: {
            start: '<body><div id="app">',
            end: '</div></body>'
        }
    },
    webpack: {
        /**
         * Webpack Server and Client Configs go here
         * Takes webpack configs and uses webpack-merge to merge them
         * */
        client: {},
        server: {}
    },
    vue: {
        /**
         * This is where you put the string versions of the
         * entry.js for server and client
         * app is for the app entry.js
         * */
        app: 'string',
        client: 'string',
        server: 'string',
    },
    head: {
        metas: [
            {
                property: 'og:title',
                content: 'Page Title'
            },
            {
                name: 'twitter:title',
                content: 'Page Title'
            },
            {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'
            }
        ],
        scripts: [
            {src: 'https://unpkg.com/vue@2.3.4/dist/vue.js'}
        ], 
        styles: [

        ]
    }
    data: {
        thing: true
    }

License

Apache-2.0 © Daniel Cherubini

2.4.0

3 years ago

2.3.2

3 years ago

2.3.1

3 years ago

2.3.0

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.12.1

5 years ago

1.12.0

5 years ago

1.11.3

5 years ago

1.11.2

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.9.0-3

5 years ago

1.9.0-2

5 years ago

1.9.0-1

5 years ago

1.9.0-0

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.0

6 years ago

1.6.8

6 years ago

1.6.7

6 years ago

1.6.5

6 years ago

1.6.6

6 years ago

1.6.4

6 years ago

1.6.3

6 years ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0-beta

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.8

6 years ago

1.2.9

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.10

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago