Giter VIP home page Giter VIP logo

autocomponents's Introduction

vuetcher (for vuejs && nuxtjs)

Examples

package for auto generating vue components, modules, services, pages.

Install

npm  i  vuetcher

or

yarn add vuetcher

Add to package.json file

{
	"scripts":{
		"dev": "nuxt & vuetcher"
	}
}

(&& - run commands async, & - run commands parallel )

And run your application

yarn dev

or

npm run dev

How does it work

Just create new folder in directory you wish generate files while you are running "dev" script.

Two options of type folder:

  • s - single
  • f- full.

Name

components

Single (s)

<template>
	<div class="{{name}}">

	</div>
</template>

<script>

import { mapActions, mapGetters } from 'vuex'

export default {
name: {{name}},

	data(){
		return{

		}
	},

	computed:{

	},

	mounted(){

	}
	}
</script>


<style lang="scss" module>
.{{name}}{
	color: initial;
	background: initial;
}
</style>

Full (f)

index.js

<template>
</template>

<script src="./{{name}}.js"></script>


<style lang="scss" module>
@import './style;
</style>

script.js

import { mapActions, mapGetters } from 'vuex'


export default {
	name: {{name}},

	data () {
		return{

		}
	},

	mounted () {

	},


	computed: {

	},

	watch: {

	}
}

style.scss

.{{name}}{
	color: initial;
	background: initial;
}

pages

Single (s)

<template>
	<div class="{{name}}">

	</div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'


export default {
	name: {{name}},

	data(){
		return{

		}
	},

	computed:{

	},

	mounted(){

	}
}
</script>


<style lang="scss" module>
.{{name}}{
	color: initial;
	background: initial;
}
</style>

services

Single (s)

import Api from './Api'

export default {
	get{{name}}(){
		return Api.get()
	}
}

store

Single (s)

import { makeCrudModule } from '~/mixins/Generator/MixinStore'
const { state, actions, getters, mutations } = makeCrudModule({
	namespace: '{{name}}'
})

export default {
	namespace: true,
	state,
	getters,
	mutations,
	actions
}

Full (f)

index.js

import * as {{name}}Actions from './actions';
import {{name}}Mutations from './mutations ';

const {{name}}Getters = {

}

const {{name}}State = () => ({

})

export default {
	namespace: true,
	state: {{name}}State,
	getters: {{name}}Getters ,
	actions: {{name}}Actions,
	mutations: {{name}}Mutations
};

actions.js

import * as {{name}}Types from './mutation_types.js';
import * as types from '~/mixins/Generator/mixinStore/mutation_types.js';
import {{name}}Services from '~/services/{{name}}Services'

export const FAN = ({commit}) =>  {

	try{

	} catch{

	}
};

mutations.js

import \* as types from './mutation_types'

export default {

}





todo:

  1. rewrite on ts
  2. vue3 components
  3. improve alerts

Thank you, will glad to help you

RESPECT

autocomponents's People

Contributors

levy-from-odessa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.