Skip to content

Instantly share code, notes, and snippets.

@nomoney4me
Last active December 14, 2017 03:42
Show Gist options
  • Save nomoney4me/a2b50a3594fae92bcbb04b9f7ee5133a to your computer and use it in GitHub Desktop.
Save nomoney4me/a2b50a3594fae92bcbb04b9f7ee5133a to your computer and use it in GitHub Desktop.
const vueOptions = {
rootPath: path.join(__dirname, '/views')
, layout: {
html: {
start: '<!doctype html><html>',
end: '</html>'
},
body: {
start:'<body class="container-fluid">',
end:'</body>'
},
template: {
start:'<div id="app" class="row">',
end:'</div>'
}
}
, vue: {
head: {
meta: [
{script: vueScript},
//{script: 'js/vue-paginate.js'},
{script: 'js/polyfill.min.js'},
{script: 'js/bootstrap-vue.js'},
{script: 'js/moment.min.js'},
{script: 'https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js'},
{script: 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js'},
{style: 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'},
{style: 'css/bootstrap-vue.css'},
{style: 'css/bootstrap.min.css'},
{style: 'css/styles.css'}
]
}
}
};
const expressVueMiddleware = expressVue.init(vueOptions);
app.use(expressVueMiddleware);
app.get('/', (req, res) => {
res.renderVue('main', ({
foo: 'bar'
}))
}
})
<template>
<div> main page </div>
</template>
<script>
export default {
data: function() {
return {
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment