111
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
export default {
|
export default {
|
||||||
install(app) {
|
install(app) {
|
||||||
const directivesList = import.meta.glob('./*.js', { eager: true });
|
const directivesList1 = import.meta.glob('./*.js', { eager: true });
|
||||||
|
const directivesList2 = import.meta.glob('./*.ts', { eager: true });
|
||||||
|
const directivesList = { ...directivesList1, ...directivesList2 };
|
||||||
|
|
||||||
// 遍历指令文件实现自动注册
|
// 遍历指令文件实现自动注册
|
||||||
Object.keys(directivesList).forEach(key => {
|
Object.keys(directivesList).forEach(key => {
|
||||||
app.directive(directivesList[key].default.name, directivesList[key].default);
|
app.directive(directivesList[key].default.name, directivesList[key].default);
|
||||||
|
|||||||
Reference in New Issue
Block a user