# Vue CLi學習#5 Vue CLi 引入外部套件 (以 Bootstrap 為例) ###### tags: `Vue cli` ## [Bootstrap5官網](https://getbootstrap.com/docs/5.0/getting-started/download/) ## 1. npm 下載 bootstrap5 在 VS CODE 的終端機使用下列指令 `npm install bootstrap` ## 2. main.js 套用 bootstrap (全域註冊) ![](https://i.imgur.com/WoyVAMQ.png) ## 在 main.js 匯入在其他檔案都可以用 ### 提醒: 在別的檔案使用時要記得加上 this (this.bootstrap) ## 如果只有一兩個檔案要使用就在單個檔案匯入即可