vuejs / vueify

Browserify transform for single-file Vue components
MIT License
1.17k stars 152 forks source link

Pug data not working in templates: how to define static data for Pug? #209

Open goodpixels opened 6 years ago

goodpixels commented 6 years ago

I am trying to use static variables in my Pug templates, like so:

template.pug

h6 Currently running version #{version}

This works perfectly fine from the CLI: pug --obj package.json template.pug --out public

But I don't know how to pass package.json to Vueify.

I tried using vue.config.js and adding a data object to it, but to no avail.

How can I achieve this? Thank you!

UPDATE:

Looking at source code for compiler.js, it seems that there is no data passed to the templates.

I found this, but it's not really helpful: https://forum.vuejs.org/t/pug-template-data-binding-in-vue-component/7437/2