初始化

This commit is contained in:
xiaoyi
2024-01-27 19:53:17 +08:00
commit 07dbe71c31
840 changed files with 119152 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
const use{{ properCase name }}Store = defineStore(
// 唯一ID
'{{ camelCase name }}',
{
state: () => ({}),
getters: {},
actions: {},
},
)
export default use{{ properCase name }}Store

View File

@@ -0,0 +1,28 @@
module.exports = {
description: '创建全局状态',
prompts: [
{
type: 'input',
name: 'name',
message: '请输入模块名称',
validate: (v) => {
if (!v || v.trim === '') {
return '模块名称不能为空'
}
else {
return true
}
},
},
],
actions: () => {
const actions = [
{
type: 'add',
path: 'src/store/modules/{{camelCase name}}.ts',
templateFile: 'plop-templates/store/index.hbs',
},
]
return actions
},
}