2022-08-16 23:30:23 +08:00
|
|
|
import { App } from 'vue';
|
|
|
|
import copy from './modules/copy';
|
|
|
|
import waterMarker from './modules/water-marker';
|
|
|
|
import draggable from './modules/draggable';
|
|
|
|
import debounce from './modules/debounce';
|
|
|
|
import throttle from './modules/throttle';
|
|
|
|
import longpress from './modules/longpress';
|
2023-03-09 15:15:28 +08:00
|
|
|
import drawerDrag from './modules/drawer-drag';
|
2022-08-16 23:30:23 +08:00
|
|
|
|
|
|
|
const directivesList: any = {
|
|
|
|
// Custom directives
|
|
|
|
copy,
|
|
|
|
waterMarker,
|
|
|
|
draggable,
|
|
|
|
debounce,
|
|
|
|
throttle,
|
|
|
|
longpress,
|
2023-03-09 15:15:28 +08:00
|
|
|
drawerDrag,
|
2022-08-16 23:30:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const directives = {
|
|
|
|
install: function (app: App<Element>) {
|
|
|
|
Object.keys(directivesList).forEach((key) => {
|
|
|
|
// 注册所有自定义指令
|
|
|
|
app.directive(key, directivesList[key]);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default directives;
|