Skip to content

Commit

Permalink
fix: export nullVue to solve warning
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Jul 20, 2022
1 parent 7ca3cfc commit 0f5817b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</a>
</p>

- [Docs](https://valaxy.yyj.moe/docs): <small>Toggle 中文|English in Sidebar</small>
- [Demo](https://valaxy.yyj.moe): <small>with [valaxy-theme-yun](./packages/valaxy-theme-yun/)</small>
- [English Docs](https://valaxy.site/?lang=en) | [中文文档](https://valaxy.site/?lang=zh-CN)
- [Demo](https://yun.valaxy.site): <small>with [valaxy-theme-yun](./packages/valaxy-theme-yun/)</small>

## Usage

Expand Down
7 changes: 6 additions & 1 deletion packages/valaxy/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ function generateAddons(options: ResolvedValaxyOptions) {
return `${imports}\n` + `export default [${components}]`
}

/**
* vue component render null
*/
const nullVue = 'import { defineComponent } from "vue"; export default defineComponent({ render: () => null });'

/**
* read from user App.vue
* @internal
Expand All @@ -89,7 +94,7 @@ function generateAddons(options: ResolvedValaxyOptions) {
function generateUserAppVue(options: ResolvedValaxyOptions) {
const userAppVue = join(options.userRoot, 'App.vue')
if (!fs.existsSync(userAppVue))
return 'export default null'
return nullVue

const scripts = [
`import UserAppVue from "${toAtFS(userAppVue)}"`,
Expand Down

0 comments on commit 0f5817b

Please sign in to comment.