-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: component props defaults & aliases (#182)
- Loading branch information
1 parent
e0bd6d9
commit 3a94b9e
Showing
57 changed files
with
1,194 additions
and
627 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
import '@anu-vue/preset-theme-default/dist/style.css' | ||
import { anu } from 'anu-vue' | ||
import 'anu-vue/dist/style.css' | ||
import 'uno.css' | ||
import DefaultTheme from 'vitepress/theme' | ||
import type { App } from 'vue' | ||
|
||
import 'uno.css' | ||
|
||
import 'anu-vue/dist/style.css' | ||
|
||
import Api from '../../components/Api.vue' | ||
import Demo from '../../components/Demo.vue' | ||
import { extractFileNameFromPath } from '../../utils' | ||
import './style.css' | ||
|
||
export default { | ||
...DefaultTheme, | ||
enhanceApp({ app }) { | ||
enhanceApp({ app }: { app: App }) { | ||
app.use(anu) | ||
|
||
// Register demos as components | ||
const demos = import.meta.globEager('../../components/demos/**/*.vue') | ||
const demos = import.meta.glob('../../components/demos/**/*.vue', { eager: true }) | ||
|
||
for (const path in demos) | ||
app.component(extractFileNameFromPath(path), demos[path].default) | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
app.component(extractFileNameFromPath(path) as string, (demos[path] as any).default) | ||
|
||
// Register UI as components | ||
const ui = import.meta.globEager('../../components/ui/**/*.vue') | ||
const ui = import.meta.glob('../../components/ui/**/*.vue', { eager: true }) | ||
|
||
for (const path in ui) | ||
app.component(extractFileNameFromPath(path), ui[path].default) | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
app.component(extractFileNameFromPath(path) as string, (ui[path] as any).default) | ||
|
||
// Other component registration | ||
/* eslint-disable vue/multi-word-component-names */ | ||
app.component('Demo', Demo) | ||
app.component('Api', Api) | ||
/* eslint-enable */ | ||
}, | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.