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

    Failed to resolve directive

    Help
    2
    4
    871
    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.
    • L
      Lou Rectoret last edited by

      Hi!

      I’m trying to create a custom directive and for some reason is failing.

      I’ve have the intuition that should be done as plugins I didn’t succeed.

      export default ({ Vue }) => {
          Vue.directive('capde', {
              bind: function (el, binding, vnode) {
                  console.log('ELEMENT', binding)
      
              }
          })
      }
      

      <section v-elemlog class="full-screen full-height">...

      1 Reply Last reply Reply Quote 0
      • O
        ouaR last edited by

        If your custom directive is called ‘capde’, you should use it like this:
        <section v-capde></section>

        1 Reply Last reply Reply Quote 0
        • L
          Lou Rectoret last edited by Lou Rectoret

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • L
            Lou Rectoret last edited by

            I’ve solved:
            Sorry the above was just another attemp. Yes it works with v-whatever-directive. @ouaR’s right! thanks!

            But real issue was because Quasar treates anything outsider kind of like a plugin. So:
            1- In quasar.conf.js file, go to plugins (make sure is not in framework.plugins array)
            2- add there your directive’s filename. NOT the directive’s name
            Done 🙂

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