desandro / draggabilly

:point_down: Make that shiz draggable

Home Page:https://draggabilly.desandro.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how can i use draggabilly in my vue project?

mzKenny opened this issue · comments

i use npm install ,and when i use {var draggie = new Draggabilly()}, console.log is { ReferenceError: Draggabilly is not defined" }

Sorry, I do not have any experience with Vue.

But you should be able to require Draggabilly

npm install draggabilly
var Draggabilly = require('draggabilly');
var draggie = new Draggabilly( element );
commented

@shouxianjun you need to

import * as Draggabilly from 'draggabilly/draggabilly';

This was months ago I'm sure you figured this out by now.

commented

use directive

import Draggabilly from 'draggabilly'

export default {
  bind(el, binding) {
    new Draggabilly(el, binding.value)
  },
}