Skip to content

Commit

Permalink
support Theme.enhanceApp
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 29, 2020
1 parent 4414f8e commit 2dd1a15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ export function createApp() {
}
})

if (Theme.enhanceApp) {
Theme.enhanceApp({
app,
router,
siteData: useSiteData()
})
}

return { app, router }
}

Expand Down
7 changes: 7 additions & 0 deletions lib/theme-default/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import Layout from './Layout.vue'

/**
* @typedef {{
* app: import('vue').App
* router: import('../app/router').Router
* siteData: import('vue').Ref<object>
* }} EnhanceAppContext
*
* @type {{
* Layout: import('vue').ComponentOptions
* NotFound?: import('vue').ComponentOptions
* enhanceApp?: (ctx: EnhanceAppContext) => void
* }}
*/
const Theme = {
Expand Down

0 comments on commit 2dd1a15

Please sign in to comment.