directives.ts 470 B

12345678910111213141516
  1. import { App } from 'vue';
  2. import { permission } from '@/directives/permission';
  3. import { scrollBar } from '@/directives/scrollBar';
  4. import { moveable } from '@/directives/moveable';
  5. /**
  6. * 注册全局自定义指令
  7. * @param app
  8. */
  9. export function setupDirectives(app: App) {
  10. app.directive('permission', permission); // 权限控制指令(演示)
  11. app.directive('scrollBar', scrollBar); // 滚动条
  12. app.directive('moveable', moveable); // 缩放拖动
  13. }