Jon Sud
Jon Sud

Reputation: 11661

How to install vue3 beta using vue/cli?

Right now vue3 is in beta and I want to try it.

Is there a way using @vue/cli to install the vue3 beta? if so, How?

Upvotes: 0

Views: 582

Answers (1)

Tom
Tom

Reputation: 134

You need the latest version of @vue/cli and then run vue add vue-next in an existing Vue CLI project.

This will:

  • Add Vue 3 and the new Vue 3 Compiler to your project
  • Configure webpack to use the new vue compiler
  • Install Vuex 4 and vue-router 4 beta (or alpha dunno where they are rn) if the older versions are in your project
  • Codemods for compatibility

More Info here

However, not every package that works with Vue2 will work with this Vue3. If all you want to try out is the new composition-api, there is a plugin which you can add which is still using Vue2 but with many of the composition-apis Features, probably all non-breaking changes? You install that by either running

npm install @vue/composition-api

or

yarn add @vue/composition-api

and then install it like this before using other APIs:


import Vue from 'vue';
import VueCompositionApi from '@vue/composition-api';

Vue.use(VueCompositionApi);

Upvotes: 1

Related Questions