index.js 711 B

123456789101112131415161718192021222324
  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. export default importDirective;