forked from NetanelBasal/vue-generate-component
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
152 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<template src="./{{name}}.{{ filesType.html }}"></template> | ||
<script src="./{{name}}.{{ filesType.script }}"{% if filesType.script !="js" %} lang="{{ filesType.script }}"{% endif %}></script> | ||
<style src="./{{name}}.{{ filesType.style }}" scoped lang="{{ filesType.style }}"></style> | ||
|
||
<template src="./{{name}}{% if postfix %}.{{postfix}}{% endif %}.{{ filesType.html }}"></template> | ||
<script src="./{{name}}{% if postfix %}.{{postfix}}{% endif %}.{{ filesType.script }}"{% if filesType.script !="js" %} lang="{{ filesType.script }}"{% endif %}></script> | ||
<style src="./{{name}}{% if postfix %}.{{postfix}}{% endif %}.{{ filesType.style }}" scoped lang="{{ filesType.style }}"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const {{name | camelCase}}Actions={ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { MutationTree } from 'vuex'; | ||
export const {{name | camelCase}}Mutations: MutationTree<any> = { | ||
// DO__SOME_ACTION(state: any, payload: entity[]) { | ||
// state.entity = payload; | ||
// }, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
export default { | ||
name: '{{name | kebabCase}}', | ||
components: {}, | ||
props: [], | ||
data () { | ||
return { | ||
import { Component, Vue } from 'vue-property-decorator'; | ||
|
||
} | ||
@Component({ | ||
components: { | ||
}, | ||
computed: { | ||
}) | ||
|
||
}, | ||
mounted () { | ||
export default class {{name | camelCase}}{{postfix | camelCase}} extends Vue { | ||
|
||
}, | ||
methods: { | ||
created(){ | ||
|
||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Module } from 'vuex'; | ||
import { {{name | camelCase}}Mutations } from 'from "./{{ name }}.mutations.{{ filesType.script }}";' | ||
import { {{name | camelCase}}Actions} from 'from "./{{ name }}.actions.{{ filesType.script }}";' | ||
class {{name | camelCase}}Store implements Module<any, any> { | ||
public state = { | ||
}; | ||
actions = { ...{{name | camelCase}}Actions} | ||
|
||
mutations = {...{{name | camelCase}}Mutations} | ||
} | ||
|
||
export default new {{name | camelCase}}Store(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.{{name | kebabCase}} { | ||
#{{name | kebabCase}} { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{% if filesType.html === 'jade' || filesType.html === 'pug' %} | ||
section(class="{{name | kebabCase}}") | ||
section(id="{{name | kebabCase}}") | ||
h1 {{name | kebabCase}} Component | ||
{% else %} | ||
<section class="{{name | kebabCase}}"> | ||
<section id="{{name | kebabCase}}"> | ||
<h1>{{name | kebabCase}} Component</h1> | ||
</section> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,73 @@ | ||
export default [{ | ||
export default [ | ||
{ | ||
name: 'help', | ||
type: Boolean, | ||
group: "options", | ||
group: 'options', | ||
description: 'help' | ||
}, | ||
}, | ||
{ | ||
name: 'html', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'set the default html templates' | ||
},{ | ||
}, | ||
{ | ||
name: 'all', | ||
type: String, | ||
group: 'options', | ||
description: 'set all files to typescript' | ||
}, | ||
{ | ||
name: 'script', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'set the default script language' | ||
},{ | ||
}, | ||
{ | ||
name: 'component', | ||
alias: 'c', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'generate Vue js component', | ||
defaultOption: true | ||
},{ | ||
}, | ||
{ | ||
name: 'spec', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'set the default spec language' | ||
},{ | ||
}, | ||
{ | ||
name: 'style', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'set the default style file' | ||
},{ | ||
}, | ||
{ | ||
name: 'directive', | ||
alias: 'd', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'generate Vue js directive' | ||
}, | ||
{ | ||
name: 'single', | ||
alias: 's', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'generate Vue js component single file' | ||
}, | ||
{ | ||
{ | ||
name: 'folder', | ||
alias: 'f', | ||
type: Boolean, | ||
group: "options", | ||
group: 'options', | ||
description: 'generate Vue js component single file inside new folder' | ||
}, | ||
{ | ||
name: 'postfix', | ||
type: String, | ||
group: "options", | ||
group: 'options', | ||
description: 'create postfix in file name' | ||
}, | ||
|
||
] | ||
} | ||
]; |
Oops, something went wrong.