From 2dd1a15d5683fa6a3ecc968d615d2baaa9b49d5a Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 29 Apr 2020 18:39:36 -0400 Subject: [PATCH] support Theme.enhanceApp --- lib/app/index.js | 8 ++++++++ lib/theme-default/index.js | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/lib/app/index.js b/lib/app/index.js index b5f846ed..8bcf7d0f 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -84,6 +84,14 @@ export function createApp() { } }) + if (Theme.enhanceApp) { + Theme.enhanceApp({ + app, + router, + siteData: useSiteData() + }) + } + return { app, router } } diff --git a/lib/theme-default/index.js b/lib/theme-default/index.js index 964ac493..d983b32b 100644 --- a/lib/theme-default/index.js +++ b/lib/theme-default/index.js @@ -1,9 +1,16 @@ import Layout from './Layout.vue' /** + * @typedef {{ + * app: import('vue').App + * router: import('../app/router').Router + * siteData: import('vue').Ref + * }} EnhanceAppContext + * * @type {{ * Layout: import('vue').ComponentOptions * NotFound?: import('vue').ComponentOptions + * enhanceApp?: (ctx: EnhanceAppContext) => void * }} */ const Theme = {