From 9d7f3d93906f8a63df376e9a97dd9bc30d452f16 Mon Sep 17 00:00:00 2001 From: yuntian001 <479820787@qq.com> Date: Thu, 22 Sep 2022 08:26:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=BB=84=E4=BB=B6=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/components.d.ts | 3 +++ vite.config.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/template/components.d.ts b/template/components.d.ts index ceec6cbb..dc6fc9ab 100644 --- a/template/components.d.ts +++ b/template/components.d.ts @@ -3,4 +3,7 @@ declare module '@vue/runtime-core' { //code } } +declare global { + //typeCode +} export {}; diff --git a/vite.config.ts b/vite.config.ts index e78364b9..5193e154 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -123,6 +123,10 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => { key: '//code', template: '{{name}}: typeof import("{{path}}")["default"];\n ', }, + { + key: '//typeCode', + template: 'type {{name}}Instance = InstanceType;\n ', + }, ], name: '_{{name}}', },