搜索结果列表页面开发
This commit is contained in:
25
src/directives/index.ts
Normal file
25
src/directives/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { App } from 'vue';
|
||||
import addTitleAtEllipsis from './add-title-at-ellipsis';
|
||||
import elementExposure from './element-exposure';
|
||||
import safeHtml from './safe-html';
|
||||
import xssProtect from './xss-protect';
|
||||
import { LoadingDirective } from 'vue-devui/loading';
|
||||
import { fileDropDirective } from 'vue-devui/upload';
|
||||
|
||||
// 注册到全局的指令
|
||||
const GLOBAL_DIRECTIVES = {
|
||||
'add-title-at-ellipsis': addTitleAtEllipsis,
|
||||
'element-exposure': elementExposure,
|
||||
'safe-html': safeHtml,
|
||||
'xss-protect': xssProtect,
|
||||
'loading': LoadingDirective,
|
||||
'file-drop': fileDropDirective
|
||||
} as { [name: string]: object; };
|
||||
|
||||
export default {
|
||||
install(app: App) {
|
||||
Object.keys(GLOBAL_DIRECTIVES).forEach((name: string) => {
|
||||
app.directive(name, GLOBAL_DIRECTIVES[name]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user