This commit is contained in:
vastxie
2025-05-31 02:28:46 +08:00
parent 0f7adc5c65
commit 86e2eecc1f
1808 changed files with 183083 additions and 86701 deletions

View File

@@ -0,0 +1,13 @@
const use{{ properCase name }}Store = defineStore(
// 唯一ID
'{{ camelCase name }}',
() => {
const someThing = ref(0)
return {
someThing,
}
},
)
export default use{{ properCase name }}Store

View File

@@ -0,0 +1,28 @@
export default {
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
},
}