

mount("#page-container"), which returns the root component instance, which mounts on the DOM element with the id page-container. Unlike Vue.js 2, this app doesn’t automatically mount, so we call. In this case, we’re going to need createApp() to create our app instance, and we’ll need defineAsyncComponent() to utilize the new Async Component API for using async components.ĬreateApp() returns an app instance, which has an app context that is available to all components in the component tree. The global Vue constructor is gone in Vue.js 3, and instead we need to explicitly import the functions from the Vue.js 3 API that we need. If you’re interested in seeing all of the major changes in Vue.js 3, check out the Vue.js merged RFCs.Īnd now, without further ado… let’s get on with the show! If you’re using vue-cli, there’s a vue-cli-plugin-vue-next plugin that will automate some of the project conversion for you, but I wanted to get my hands dirty.

WEBSTORM VUE SUPPORT HOW TO
How to use async components in Vue 3 using new Async Component API.How to do webpack dynamic imports of Vue 3 APIs.The changes needed to instantiate a new Vue app.Changes needed to your webpack config.Changes needed to your package.json file.The app.js is just a shell that doesn’t do much of anything other than load the VueConfetti component, but the project does demonstrate some interesting things:

This skeleton code is what I use for my scaffolding, because it’s nice to see some confetti to indicate that your code is working as intended. We have a single JavaScript entry point app.js file, and a VueConfetti component. The changes we’re going to be making here are really relatively trivial.
