Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hikerpig/vue-classify
Convert option-object style vue component to typescript class component
https://github.com/hikerpig/vue-classify
babel transformer typescript vue
Last synced: 4 months ago
JSON representation
Convert option-object style vue component to typescript class component
- Host: GitHub
- URL: https://github.com/hikerpig/vue-classify
- Owner: hikerpig
- License: mit
- Created: 2019-01-15T06:55:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T19:26:17.000Z (about 2 years ago)
- Last Synced: 2024-10-13T13:37:24.494Z (4 months ago)
- Topics: babel, transformer, typescript, vue
- Language: TypeScript
- Homepage:
- Size: 1.4 MB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-classify
[](https://travis-ci.org/hikerpig/vue-classify)
[](https://coveralls.io/github/hikerpig/vue-classify?branch=master) [](https://greenkeeper.io/)
Convert option-object style vue component to [vue-class-component](https://github.com/vuejs/vue-class-component) decorated class.
Inspired by [vue-to-react](https://github.com/dwqs/vue-to-react).
Here is an [online demo](https://vue-classify-demo.surge.sh)
# Install
```bash
npm i -g vue-classify # or yarn global add vue-classify
```# Usage
```
Usage: vue-classify [options]Options:
-V, --version output the version number
-i, --input the input path for vue component
-o, --output the output path for new component, which default value is process.cwd()
-n, --name the output file name, which default value is "classified.ts"
-h, --help output usage informationExamples:
# transform a vue option-object style component to class component.
$ vue-classify ./components/option-object.js ./components/Component.ts
$ vue-classify -i ./components/option-object.js -o ./components/ -n Component
```# Preview Screenshots
## Convert props
## SFC

# Features
- props/watch -> vue-property-decorator decorated class properties
- computed -> class getter and setter
- lifecycle hooks -> class methods
- methods -> class methods
- other options will be passed to @Component decorator