Still under development and there's still a long way to go :o
npm i vue2svelte
# or
yarn add vue2svelte
Get a Vue options object and convert it into a svelte component
Compiler Roadmap:
...
import Vue2Svelte from 'vue2svelte'
const VueComponent = {
template: `<div><span v-for="item in list">{{ item }}</span></div>`,
props: {
list: {
default: ['item 1', 'item 2']
}
},
data () {
return {
hello: 'world'
}
}
}
const SvelteComponent = new Vue2Svelte(VueComponent)
console.log(SvelteComponent.compile())
// Output: <script>export let list=["item 1","item 2"];let hello="world";</script><div>{#each list as item}<span>{item}</span>{/each}</div>
Currently it can compile simple pure components with props and data.
This project is a little bit complex, so if you can help please do it!