Skip to content

Commit

Permalink
chore: fix params
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Sep 11, 2024
1 parent 3bb73dc commit cb80a9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/bundler-vite/src/plugins/vuepressMarkdownPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export const vuepressMarkdownPlugin = ({ app }: { app: App }): Plugin => ({

// if the page content is not changed, render it to vue component directly
if (page?.content === code) {
return renderPageToVue(page)
return renderPageToVue(app, page)
}

// create a new page with the new content
const newPage = await createPage(app, {
content: code,
filePath: id,
})
return renderPageToVue(newPage)
return renderPageToVue(app, newPage)
},

async handleHotUpdate(ctx) {
Expand All @@ -41,6 +41,6 @@ export const vuepressMarkdownPlugin = ({ app }: { app: App }): Plugin => ({
filePath: ctx.file,
})

ctx.read = () => renderPageToVue(newPage)
ctx.read = () => renderPageToVue(app, newPage)
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export const vuepressMarkdownLoader: LoaderDefinitionFunction<VuepressMarkdownLo

// if the page content is not changed, render it to vue component directly
if (page?.content === source) {
return renderPageToVue(page)
return renderPageToVue(app, page)
}

// create a new page with the new content
const newPage = await createPage(app, {
content: source,
filePath: this.resourcePath,
})
return renderPageToVue(newPage)
return renderPageToVue(app, newPage)
}
2 changes: 1 addition & 1 deletion packages/core/src/app/prepare/preparePageChunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import type { App, Page } from '../../types/index.js'
*/
export const preparePageChunk = async (app: App, page: Page): Promise<void> => {
if (page.filePath === null) {
await app.writeTemp(page.chunkFilePathRelative, renderPageToVue(page))
await app.writeTemp(page.chunkFilePathRelative, renderPageToVue(app, page))
}
}

0 comments on commit cb80a9e

Please sign in to comment.