Create a PageLayout
component that receives 3 slots: default, footer
and header
. Make the three pages use the layout, like following:
Page1
uses defaultfooter
andheader
slot contentPage2
has its ownheader
slot contentPage3
has its ownfooter
slot content
- make
Page1
hide thefooter
(while the other two pages continue to work as expected) - make the 3 pages lazy load
- use the following markup:
<header>
here be default header
</header>
<div class="content">
here be content
</div>
<footer>
here be default footer
</footer>
- to build and serve the app use
yarn task5-serve
- use
syntax-dynamic-import
babel plugin
// babel.config.js
module.exports = {
// ...
plugins: ['@babel/plugin-syntax-dynamic-import'],
};
- remove the
prefetch
webpack plugin
// vue.config.js
chainWebpack: config => {
config.plugins.delete('prefetch');
};