draggable.ts 567 B

1234567891011121314151617181920212223
  1. import { defineComponent, h } from "vue";
  2. import { constants } from "smooth-dnd";
  3. import { getTagProps, validateTagProp } from "./utils";
  4. const Draggable = defineComponent({
  5. props: {
  6. tag: {
  7. validator: validateTagProp,
  8. default: "div",
  9. },
  10. },
  11. setup(props, ctx) {
  12. const tagProps = getTagProps(props, constants.wrapperClass);
  13. return () =>
  14. h(tagProps.value, Object.assign({}, tagProps.props), {
  15. default: () =>
  16. ctx.slots.default ? ctx.slots.default() : "default wrap",
  17. });
  18. },
  19. });
  20. export default Draggable;