first commit
This commit is contained in:
10
ui/generators/new/module/module.ejs.t
Normal file
10
ui/generators/new/module/module.ejs.t
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
to: src/state/modules/<%= h.changeCase.kebab(name) %>.js
|
||||
---
|
||||
export const state = {}
|
||||
|
||||
export const getters = {}
|
||||
|
||||
export const mutations = {}
|
||||
|
||||
export const actions = {}
|
||||
13
ui/generators/new/module/prompt.js
Normal file
13
ui/generators/new/module/prompt.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message: 'Name:',
|
||||
validate(value) {
|
||||
if (!value.length) {
|
||||
return 'Vuex modules must have a name.'
|
||||
}
|
||||
return true
|
||||
},
|
||||
},
|
||||
]
|
||||
13
ui/generators/new/module/unit.ejs.t
Normal file
13
ui/generators/new/module/unit.ejs.t
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
to: src/state/modules/<%= h.changeCase.kebab(name) %>.unit.js
|
||||
---
|
||||
<%
|
||||
const fileName = h.changeCase.kebab(name)
|
||||
const importName = h.changeCase.camel(fileName) + 'Module'
|
||||
%>import * as <%= importName %> from './<%= fileName %>'
|
||||
|
||||
describe('@state/modules/<%= fileName %>', () => {
|
||||
it('exports a valid Vuex module', () => {
|
||||
expect(<%= importName %>).toBeAVuexModule()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user