1.1.0 • Published 5 years ago

@evoteam/vue-generate-component v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

Vue js component generator

CLI util for easy generate Vue compoenent generator.

Installation

npm install -g @evoteam/vue-generate-component

Usage

vg --help

Create new component

vg hello-world

Will generate two files:

hello-world.ts

import {Component, Vue} from "vue-property-decorator";

@Component({
  components: {}
})
export default class HelloWorld extends Vue {

}

index.vue

<template>

    <div>
      hello-world Works!
    </div>

</template>

<style scoped lang="scss">

</style>

<script src="./hello-world.ts" lang="ts"></script>

Create new component single file

vg -s home

will generate one vue file:

<template lang="html">

    <div>
      hello-world Works!
    </div>

</template>

<script lang="ts">

  import {Component, Vue} from "vue-property-decorator";

  @Component({
    components: []
  })
  export default class HelloWorld extends Vue {


  }

</script>

<style scoped lang="scss">

</style>

Create new component single file inside new folder

vg -s home --folder

If you want use postfix in file name, use -- postfix

vg footer --postfix page

Will generate files with postfix:

  • footer.page.js
  • footer.page.css
  • footer.page.html
  • footer.page.spec.js

Change the default file types for html, style, script, and spec

sudo vg --html jade --style less --script ts --spec ts

Forked from https://github.com/NetanelBasal/vue-generate-component