0.0.11 • Published 5 years ago

vue2svelte v0.0.11

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Vue2Svelte

Demo Demo Image

Still under development and there's still a long way to go :o

Install

npm i vue2svelte
# or
yarn add vue2svelte

Main Goal

Get a Vue options object and convert it into a svelte component

Compiler Roadmap:

  • Simple HTML elements rendering
  • Default props values
  • Simple properties declaration
  • v-if statements
  • v-else and v-else-if statements
  • v-for statements
  • v-once statements
  • v-model support
  • v-bind:prop / :prop support
  • v-bind="obj" support
  • Methods
  • Computed properties
  • Mixins
  • Lifecycle hooks
  • Calls to $nextTick
  • Filters
  • Calls to $options

...

Usage

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!

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago