From 8220f4b3669d773a620b1fbb32483dc171158230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Sat, 21 May 2022 13:43:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9plop=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plop/store-template/index.hbs | 2 +- plop/store-template/prompt.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plop/store-template/index.hbs b/plop/store-template/index.hbs index 702352da..5722a89d 100644 --- a/plop/store-template/index.hbs +++ b/plop/store-template/index.hbs @@ -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: {} }) \ No newline at end of file diff --git a/plop/store-template/prompt.js b/plop/store-template/prompt.js index 180cbd26..4fab8a88 100644 --- a/plop/store-template/prompt.js +++ b/plop/store-template/prompt.js @@ -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, + } }, ]