0

I am using flickity, but it is not initialized, I have to do it manually in the google chrome console.

index.html

<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">
<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js" defer></script>

page.vue

<div class="carousel" data-flickity='{ "autoPlay": true }'>
  <div class="carousel-cell"></div>
  <div class="carousel-cell"></div>
  <div class="carousel-cell"></div>
  <div class="carousel-cell"></div>
  <div class="carousel-cell"></div>
</div>

already try manually in the index.html in this way

$('.carousel').flickity();
  • Are you using the webpack version of vue? – samayo Mar 30 '18 at 01:31
  • @samayo yes, It is a project generated with vue-cli – Carlos Uriel Santiago Mar 30 '18 at 01:37
  • then have you tried doing like this https://github.com/misterGF/CoPilot/blob/08212c164a314ff38a274d699745f4fc9c0070bb/src/components/views/Tables.vue#L199 and then use it – samayo Mar 30 '18 at 01:41
  • yes but I get the following error `[Vue warn]: Error in mounted hook: "TypeError: __WEBPACK_IMPORTED_MODULE_0_jquery___default(...)(...).flickity is not a function" found in ---> at src/components/profile/show.vue at src/components/layouts/profile.vue at src/App.vue ` @semayo – Carlos Uriel Santiago Mar 30 '18 at 01:49
  • then that is a jquery error, maybe it's a library or something – samayo Mar 30 '18 at 01:50

0 Answers0