work.suroh.tk/node_modules/@11ty/eleventy/test/stubs/vue.11ty.js

17 lines
386 B
JavaScript
Raw Normal View History

2019-12-02 12:22:45 +00:00
const Vue = require("vue");
const renderer = require("vue-server-renderer").createRenderer();
module.exports = async function(templateData) {
var app = new Vue({
template: "<p>Hello {{ data.name }}, this is a Vue template.</p>",
data: {
data: templateData
}
// components: {
// 'test': ComponentA
// }
});
return renderer.renderToString(app);
};