Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miyaoka/vue-composition-converter
Vue composition API converter
https://github.com/miyaoka/vue-composition-converter
vue
Last synced: 6 days ago
JSON representation
Vue composition API converter
- Host: GitHub
- URL: https://github.com/miyaoka/vue-composition-converter
- Owner: miyaoka
- License: mit
- Created: 2021-02-06T09:11:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T14:56:58.000Z (11 months ago)
- Last Synced: 2023-12-15T15:58:58.214Z (11 months ago)
- Topics: vue
- Language: TypeScript
- Homepage: https://vue-composition-converter.vercel.app
- Size: 133 KB
- Stars: 99
- Watchers: 5
- Forks: 12
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-composition-converter
Convert optionsAPI into composition API
## demo
https://vue-composition-converter.vercel.app/
## convert options into `setup`
- data, computed, watch, methods, lifecycle, props -> setup()
- data -> ref()
- computed -> computed()
- watch -> watch()
- methods -> function
- lifecycle -> lifecycle hooks
- beforeCreate, created -> Immediate function
- props -> toRefs()## convert `this`
- this.prop
- (toRefs, ref, computed) -> prop.value
- (other) -> prop
- this.$globalProp -> ctx.root.$globalProp