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