jQuery UI - Draggable is not a function?

后端 未结 17 2670
旧时难觅i
旧时难觅i 2020-11-27 18:49

I\'ve trying to use the draggable effect on some divs on a page, but whenever I load the page, I get the error message:

Error: $(\".draggable\").draggable is         


        
17条回答
  •  自闭症患者
    2020-11-27 19:13

    1. Install jquery-ui-dist

      use npm

      npm install --save jquery-ui-dist

      or yarn

      yarn add jquery-ui-dist

    2. Import it inside your app code

      import 'jquery-ui-dist/jquery-ui';

      or

      require('jquery-ui-dist/jquery-ui');

提交回复
热议问题