vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.29k stars 926 forks source link

怎么动态注册components下面所有文件的组件实例 #1391

Closed ChYuanJinlin closed 1 year ago

ChYuanJinlin commented 1 year ago

Clear and concise description of the problem

我我想动态获取components下面所有文件的组件实例,这个要怎么搞

Suggested solution

vite 可以用import.meta.glob 但是这个不行

Alternative

No response

Additional context

No response

github-actions[bot] commented 1 year ago

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 7 days.

Mister-Hope commented 1 year ago

Sounds to be the same problem as https://github.com/vuepress/vuepress-next/issues/1226.

Try import.meta.glob('@source/.vuepress/compnoents/**) and see if it works.

Mister-Hope commented 1 year ago

Any update?