mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
解决自定义指令无法自动注册的问题
This commit is contained in:
parent
223badb2ec
commit
2bea8cd73d
@ -72,6 +72,10 @@ export function createModule(app: App) {
|
|||||||
|
|
||||||
if (d) {
|
if (d) {
|
||||||
Object.assign(e, d);
|
Object.assign(e, d);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安装事件
|
||||||
|
e.install?.(app, d.options);
|
||||||
|
|
||||||
// 注册组件
|
// 注册组件
|
||||||
e.components?.forEach(async (c: any) => {
|
e.components?.forEach(async (c: any) => {
|
||||||
@ -85,12 +89,6 @@ export function createModule(app: App) {
|
|||||||
app.directive(v.name, v.value);
|
app.directive(v.name, v.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 安装事件
|
|
||||||
if (d.install) {
|
|
||||||
d.install(app, d.options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 合并
|
// 合并
|
||||||
deepMerge(service, mergeService(e.services || []));
|
deepMerge(service, mergeService(e.services || []));
|
||||||
|
|
||||||
|
5
src/modules/demo/directives/color.ts
Normal file
5
src/modules/demo/directives/color.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export default {
|
||||||
|
created(el: HTMLElement, binding: any) {
|
||||||
|
el.style.color = binding.value;
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user