moveable icon indicating copy to clipboard operation
moveable copied to clipboard

How can i create a custom-able using Vue 3 ?

Open ulissepress opened this issue 2 years ago • 1 comments

Environments

  • Framework name:
  • Framework version:
  • Moveable Component version:
  • Testable Address(optional):

Description

I would like to create a custom-able but in the docs I only found examples using react. I would like to use Vue3 for that.

Something like this: https://daybrush.com/moveable/storybook/?path=/story/make-custom-able--dimensionviewable

ulissepress avatar Jun 01 '22 16:06 ulissepress

This is an example based on JSX.

You can use it as Renderer.createElement. Demos of other frameworks are still being prepared.

const DimensionViewable = {
    name: "dimensionViewable",
    props: {},
    events: {},
    render(moveable: MoveableManagerInterface<any, any>, Renderer: Renderer) {
        const rect = moveable.getRect();

        // Add key (required)
        // Add class prefix moveable-(required)
        return Renderer.createElement("div", { key: "dimension-viewer", ...}, ....);
    }
} as const;

daybrush avatar Jun 09 '22 14:06 daybrush