安装typescript
先将node安装,然后在通过npm安装ts的包
npm install -g typescript
tsc -v 查看ts的版本号
第一步【下载最新版本@vue/cli】
npm i -g @vue/cli
Microsoft Windows [版本 10.0.18362.1082]
(c) 2019 Microsoft Corporation。保留所有权利。
C:\Users\Lenovo\Desktop\1910-高级程序设计\项目>vue create ts-vue
Vue CLI v4.5.6
? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, TS, Router, Vuex
? Choose a version of Vue.js that you want to start the project with 2.x
? Use class-style component syntax? No
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? No
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
Vue CLI v4.5.6
✨ Creating project in C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue.
� Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
> yorkie@2.0.0 install C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\yorkie
> node bin/install.js
setting up Git hooks
done
> ejs@2.7.4 postinstall C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\ejs
> node ./postinstall.js
added 1139 packages from 899 contributors in 35.49s
47 packages are looking for funding
run `npm fund` for details
� Invoking generators...
� Installing additional dependencies...
added 6 packages from 2 contributors in 5.591s
47 packages are looking for funding
run `npm fund` for details
⚓ Running completion hooks...
� Generating README.md...
� Successfully created project ts-vue.
� Get started with the following commands:
$ cd ts-vue
$ npm run serve
C:\Users\Lenovo\Desktop\1910-高级程序设计\项目>cd ts-vue
C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue>npm run serve
> ts-vue@0.1.0 serve C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue
> vue-cli-service serve
INFO Starting development server...
Starting type checking service...
Using 1 worker with 2048MB memory limit
10% building 0/1 modules 1 active ...Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack\hot\dev-server.js ./src/10% building 2/4 modules 2 active C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack\hot\dev-ser10% building 2/5 modules 3 active ...ader\index.js??ref--12-1!C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\src\10% building 3/5 modules 2 active ...ader\index.js??ref--12-1!C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\src\10% building 4/5 modules 1 active ...ader\index.js??ref--12-1!C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\src\10% building 4/6 modules 2 active ...sktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack\hot sync nonrecursive /^\.10% building 5/6 modules 1 active ...ader\index.js??ref--12-1!C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\src\40% building 6/8 modules 2 active ...\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack\hot\log-apply-re40% building 6/9 modules 3 active C:\Users\Lenovo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack\hot\emitter40% building 6/10 modules 4 active ...o\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack-dev-server\client\ove40% building 6/11 modules 5 active ...vo\Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack-dev-server\client\so40% building 6/12 modules 6 active ...Desktop\1910-高级程序设计\项目\ts-vue\node_modules\webpack-dev-server\client\u