docs: 添加示例注释以说明全局组件的命名规则
This commit is contained in:
@@ -2,6 +2,11 @@ import type { App, Component } from "vue";
|
||||
|
||||
const modules: Record<string, { default: Component }> = import.meta.glob("./*/*.vue", { eager: true });
|
||||
|
||||
/**
|
||||
* @example /avatar/index.vue => UiAvatar
|
||||
* @example /tabs/index.vue => UiTabs
|
||||
* @example /tabs/tab-pane.vue => UiTabPane
|
||||
*/
|
||||
function setupUiGlobalComponents(app: App) {
|
||||
for (const path in modules) {
|
||||
const parts = path.replace(/^\.\//, "").replace(/\.vue$/, "").split("/");
|
||||
|
||||
Reference in New Issue
Block a user