在使用 Vue 2 和 Vue CLI 時,這個問題在幾個方面讓我感到困惑,現在又開始了一個新的 Vue 3.0 beta 項目。Even with the currently newest Vue CLI version 4.3.1, when choosing TypeScript option, the boilerplate code you are given has compilerOptions target set as esnext in tsconfig.json.雖然Vue 2 TypeScript 指南正在指導:# Recommended Configuration// tsconfig.json{ "compilerOptions": { // this aligns with Vue's browser support "target": "es5", // this enables stricter inference for data properties on `this` "strict": true, // if using webpack 2+ or rollup, to leverage tree shaking: "module": "es2015", "moduleResolution": "node" }}目前Vue Next repo 正在使用esnext,雖然此時 IE11 支持尚未準備好(但無論如何可能不會影響此配置)...使用 Vue 3 時,此編譯器目標的推薦設置是什么?我需要支持低至 IE11 的舊版瀏覽器,但這個特定的應用程序項目在其初始發布之前有足夠的時間等待 Vue 3 的完整發布。
Vue 3 推薦 TypeScript TSConfig compilerOptions
侃侃無極
2022-07-08 15:43:36