index.js 899 B

12345678910111213141516171819202122232425262728293031
  1. import directive from './directives';
  2. const importDirective = (Vue) => {
  3. /**
  4. * 拖拽指令 v-draggable="options"
  5. * options = {
  6. * trigger: /这里传入作为拖拽触发器的CSS选择器/,
  7. * body: /这里传入需要移动容器的CSS选择器/,
  8. * recover: /拖动结束之后是否恢复到原来的位置/
  9. * }
  10. */
  11. Vue.directive('draggable', directive.draggable);
  12. /**
  13. * clipboard指令 v-draggable="options"
  14. * options = {
  15. * value: /在输入框中使用v-model绑定的值/,
  16. * success: /复制成功后的回调/,
  17. * error: /复制失败后的回调/
  18. * }
  19. */
  20. Vue.directive('clipboard', directive.clipboard);
  21. /**
  22. * v-auth="['string-string']"
  23. * */
  24. Vue.directive('auth', directive.auth);
  25. Vue.directive('permission', directive.permission);
  26. Vue.directive('dbClick', directive.dbClick);
  27. };
  28. export default importDirective;