0.1.10 • Published 6 years ago

vue-component-scaffold v0.1.10

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

A npm based cli tool to generate vue components.

Installation

npm install -g vue-component-scaffold

Minimal Example

vc Scrollbar

will generate the Scrollbar.vue with the following:

<template>
  <div>
  </div>
</template>

<script>
  export default {
    name: 'Scrollbar'
  }
</script>

<style scoped>
</style>

Passing Vue API options

Using the --options argument, you can have lifecycle options and dta options. For example vc MyTest --options=props,created,mounted will produce the following:

<template>
  <div>
  </div>
</template>

<script>
  export default {
    name: 'MyTest',

    props: {
    },

    created () {
    },

    mounted () {
    }
  }
</script>

<style scoped>
</style>

Generating a Test

Passing the -t argument will generate a test (assumes you are using vue-test-utils, the official library for testing Vue components).

vc MyComponent -t will generate MyComponent.test.js, with:

import { shallow } from 'vue-test-utils'
import MyComponent from './MyComponent'

describe('MyComponent', () => {
  it('renders', () => {
    const wrapper = shallow(MyComponent)
  })
})

To develop: run the tests with npm run test. Adding new features? Add a test and make a PR. Or an issue and I'll add it. Contributions are welcome!

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago