Jump to content
Search Community

Toni-98

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Toni-98

  1.  

    On 4/12/2019 at 2:31 PM, nicoladelazzari said:

    Thank you for the answers! ?

     

    Now this is my situation:

    
    import TweenMax from 'gsap/TweenMax'
    import Draggable from 'gsap/Draggable'
    if (process.client) {
      require('~/assets/vendor/ThrowPropsPlugin')
    }

     

    response:

    
      41:8  warning  Using exported name 'TweenMax' as identifier for default export   import/no-named-as-default
      42:8  warning  Using exported name 'Draggable' as identifier for default export  import/no-named-as-default

     

    And the browser error is: 

    Unexpected identifier
     

    What is going on?

     

    Schermata 2019-04-12 alle 14.29.07.png

     

     

     

     

    Try this:
     

    nuxt.config.js
    
    build: {
      transpile: [
        "gsap"
      ],
    }


     

    In a page or elsewhere
    
    <script>
    import { gsap } from "gsap";
    import { Draggable } from 'gsap/Draggable';
    
    export default {
      mounted() {
        if (process.client) {
    		// Here you can use gsap now and draggable
        }
      }
    }
    
    </script>

     

×
×
  • Create New...