fix: 修改plop模板的错误

This commit is contained in:
奔跑的面条 2022-05-21 13:43:31 +08:00
parent c69f9b09ec
commit 8220f4b366
2 changed files with 7 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import { StorageEnum } from '@/enums/storageEnum'
export const use{{upperDataName}}Store = defineStore({
id: 'use{{upperDataName}}Store',
state: (): {{name}}StoreType => ({}),
state: (): {{upperDataName}}StoreType => ({}),
getters: {},
actions: {}
})

View File

@ -22,7 +22,7 @@ module.exports = {
const actions = [
{
type: 'add',
path: `${process.cwd()}/src/store/modules/${dataName}Store/${dataName}Store}.ts`, // 这里的name就是上面定义的键
path: `${process.cwd()}/src/store/modules/${dataName}Store/${dataName}Store.ts`, // 这里的name就是上面定义的键
templateFile: './store-template/index.hbs',
data: {
name: data.name,
@ -32,7 +32,11 @@ module.exports = {
{
type: 'add',
path: `${process.cwd()}/src/store/modules/${dataName}Store/${dataName}Store.d.ts`, // 这里的name就是上面定义的键
templateFile: './store-template/index.d.hbs'
templateFile: './store-template/index.d.hbs',
data: {
name: data.name,
upperDataName,
}
},
]