Created
October 29, 2019 10:54
-
-
Save iliakan/e99834f1829ebb5ea1eb44024704eda4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default async function(pageModule, route) { | |
const {default: Page} = await import(`../src/pages/${pageModule}`); | |
const page = new Page(route); | |
const renderedPage = await page.render(); | |
const contentNode = document.querySelector('#content'); | |
contentNode.innerHTML = ''; | |
contentNode.appendChild(renderedPage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment