哎呦,又是学习的一天!!!
······
前端vue+ts快速配置,不用手动配置,自动生成!!!
一、直接下载项目
vue create 项目名 不用做任何配置(按需添加)
二、添加ts之后(script lang="ts"自动添加)
vue add typescript
运行npm run serve
(补充:我的选择ts:
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Convert all .js files to .ts? Yes
? Allow .js files to be compiled? Yes
? Skip type checking of all declaration files (recommended for apps)? No
)
相关命令学习:
npm install -g typescript
tsc --init创建t