第一步(安裝npm)
?官網地址:https://nodejs.org/en/download
windows安裝yarn 詳細教程_windows yarn-CSDN博客
第二步(yarn下載)
windows 下需要下載msi文件 ,下載地址:https://yarnpkg.com/latest.msi
npm install -g yarn
安裝完成后,你可以測試下自己的版本
yarn --version
第三步(國內鏡像)
1、設置淘寶鏡像源 npm config set registry https://registry.npm.taobao.org/
2、查看鏡像使用狀態: npm config get registry
如果返回https://registry.npm.taobao.org/,說明配置的是淘寶鏡像。
如果要在設置成官網npm config set registry https://registry.npmjs.org
第四步(使用npm下載vue)
使用npm下載vue
vue npm i @vue/cli -g
查看vue版本
vue -version
第五步(導入bootstrap依賴)
npm install bootstrap
main.js導包
import 'bootstrap/dist/css/bootstrap.css' //引用bootstrap的樣式
import 'bootstrap/dist/js/bootstrap.min.js' //引用bootstrap的js