itshizhan / vue2react

Transform Vue component to React component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vue2react

A tool that transforms Vue component to React component.

The tool will be more stronger and supports more syntax.

Install

npm i vue2react -g

or

yarn add vue2react -g

Usage

bash example

vtr -i hello.vue -o ./screen -n nihao.js
vtr hello.vue ./screen nihao.js
vtr hello.vue

vtr help infomation

Usage: vtr [options]

Options:
  -V, --version  output the version number
  -i, --input    the input path for vue component
  -o, --output   the output path for react component, which default value is process.cwd()
  -n, --name     the output file name, which default value is "react.js"
  -h, --help     output usage information

Example

Left code is Vue, and the right one is React.

Demo1

Demo2

Inspired by

vue-to-react

About

Transform Vue component to React component


Languages

Language:TypeScript 80.7%Language:JavaScript 12.2%Language:Vue 6.6%Language:CSS 0.4%