From 19dfe2804899b24a220f7b20d908b420539626fd Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 15 Nov 2022 15:50:26 +0800 Subject: [PATCH] =?UTF-8?q?update(typescript):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/tutorial/typescript-subject.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/tutorial/typescript-subject.md b/docs/tutorial/typescript-subject.md index 4ebf794bd..7ac77ee16 100644 --- a/docs/tutorial/typescript-subject.md +++ b/docs/tutorial/typescript-subject.md @@ -27,14 +27,25 @@ uni-app 支持使用 ts 开发,可参考 [Vue.js TypeScript 支持](https://cn // tsconfig.json { "compilerOptions": { - // 与 Vue 的浏览器支持保持一致 - "target": "es5", - // 这可以对 `this` 上的数据 property 进行更严格的推断 + "target": "esnext", + "module": "esnext", "strict": true, - // 如果使用 webpack 2+ 或 rollup,可以利用 tree-shake: - "module": "es2015", + "jsx": "preserve", "moduleResolution": "node", - "types": ["@dcloudio/types"] + "esModuleInterop": true, + "sourceMap": true, + "skipLibCheck": true, + "importHelpers": true, + "allowSyntheticDefaultImports": true, + "useDefineForClassFields": true, + "resolveJsonModule": true, + "lib": [ + "esnext", + "dom" + ], + "types": [ + "@dcloudio/types" + ] } } ``` -- GitLab