diff --git a/src/util/with_layout.js b/src/util/with_layout.js new file mode 100644 index 0000000..2b6c5e3 --- /dev/null +++ b/src/util/with_layout.js @@ -0,0 +1,15 @@ +export default config => { + if (typeof config == 'undefined') + config = {} + + if (!config.hasOwnProperty('content')) + config = {'content': config} + + return { + view: vnode => [ + config.prologue, + m('main', config.content), + config.epilogue + ] + } +}