1.0.16 • Published 3 years ago

vue-movable-v3 v1.0.16

Weekly downloads
77
License
-
Repository
-
Last release
3 years ago

vue-movable-v3

Movable box based on vue 3

install

npm install vue-movable-v3 --save

usage

Movable(
  v-model:x="x"
  v-model:y="y"
  v-model:width="width"
  v-model:height="height"

  :direction="direction"
  :movable="movable"
  :scale="scale"
  :resizable="resizable"
  @move="onMove"
  @resize="onResize")
  .h2 Child elements
import Movable from "vue-movable-v3";

export default defineComponent({
  components: {
    Movable
  },
  setup() {
    const x = ref(100)
    const y = ref(100)
    const width = ref(100)
    const height = ref(100)
    const movable = ref(true)
    const resizable = ref(true)

    function onMove(mx, my) {
      // x.value = mx.value
      // y.value = my.value
    }
    function onResize(w, h) {
      // width.value = w.value
      // height.value = h.value
    }

    return {
      x, y,
      width,
      height,
      direction: 'x',
      movable,
      resizable

      onMove,
      onResize
    }
  }
}
1.0.16

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago