1.0.4 • Published 10 months ago

vue_miga v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Vue-miga

Tool to migrate Vue 2 component from class component or option component to composition API.

After migrate to composition API, you could move to Vue 3 quite easily.

(ClassAPI | OptionAPI) => CompositionAPI

Limitations

Built with many assumptions so there might be some cases that cannot fully migrate and need some manual jobs.

Installation

Download the whole folder and run the below block. Remember to let <THE_PATH_OF_MIGA> point to the folder that this project is at

export VUE_MIGA_HOME=<THE_PATH_OF_MIGA>
export PATH=$VUE_MIGA_HOME/bin:$PATH

cd $VUE_MIGA_HOME
chmod +x bin/miga

Before using

This tool will emit code that use @vue/composition-api package, so your project need to have it before running this tool:

Install the @vue/composition-api package:

npm install @vue/composition-api

Add composition-api to main.ts:

import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'

Vue.use(VueCompositionAPI)

Usages

Change dir your shell to the root folder of the project that you want to convert. Foreach file you want to migrate, run:

miga <file_path>
1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

0.0.1

10 months ago

1.0.0

10 months ago