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 Composition API

    Help
    2
    5
    1934
    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.
    • H
      hamiltoes last edited by

      Is there any way to enable the new composition API? It must be imported before App.vue, such as

      import Vue from 'vue'
      import VueCompositionApi from '@vue/composition-api'
      
      // Register the Composition API plugin BEFORE you import App.vue
      Vue.use(VueCompositionApi)
      
      import App from './App.vue'
      

      Unfortunately, boot files did not work for this because in the generated client-entry.js, they are imported immediately after app.js (and therefore App.vue).

      1 Reply Last reply Reply Quote 0
      • H
        hamiltoes last edited by

        Nevermind, found the new starter kit with composition api in discord.

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

          Where? Link to the repo please. 🙂

          Scott

          1 Reply Last reply Reply Quote 0
          • H
            hamiltoes last edited by

            @s-molinari after upgrading quasar, creating a new project using the CLI with quasar create project-name, gives an option for composition api components.

            And I was wrong in my initial post: you can just enable composition api via boot files.

            Here’s the boot file I’m now using:

            // composition-api.js
            import VueCompositionApi from '@vue/composition-api';
            import { boot } from 'quasar/wrappers';
            
            export default boot(({ Vue }) => {
              Vue.use(VueCompositionApi);
            });
            
            1 Reply Last reply Reply Quote 2
            • s.molinari
              s.molinari last edited by

              Ah. I understand now what the deal is, as I personally didn’t realize we offered the composition API plugin as a choice to get installed when TS is selected. Thanks for getting back to us on this with the solution.

              Scott

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