No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Vue use custom JavaScript plugin

    Help
    3
    6
    2112
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sergiuwd last edited by sergiuwd

      Hi!
      I have a custom JavaScript plugin I need to use inside the “created” hook of some components. It’s a slideshow plugin that returns an object so i can call var slidesnow = new SlideShow(target)
      How can I achieve that? I’m a Vue noobie.

      This is the plugin I need to use: https://jsfiddle.net/k5nvyqkp/1/

      1 Reply Last reply Reply Quote 0
      • S
        sergiuwd last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • s.molinari
          s.molinari last edited by

          How about just using the slider component?

          Also, this is how to add a plug-in to vue. https://vuejs.org/v2/guide/plugins.html#Writing-a-Plugin

          Scott

          S 1 Reply Last reply Reply Quote 0
          • S
            sergiuwd @s.molinari last edited by

            @s.molinari I need to use this exact plugin for the sake of design & UX.

            1 Reply Last reply Reply Quote 0
            • rstoenescu
              rstoenescu Admin last edited by

              Use a Vue reference on the target node in the template. On the mounted() hook, inside a this.$nextTick() use that Vue reference (new SlideShow(this.$refs.<target-ref-name>).

              1 Reply Last reply Reply Quote 0
              • S
                sergiuwd last edited by sergiuwd

                I have managed to access the constructor in the hook using window.SlideShow and the script is required using regular <script> tags in the index.html file.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post