首頁  >  問答  >  主體

javascript - vue怎麼引入boostrap.css及其字型文件

我在a.vue檔中

<style>
    @import '../css/bootstrap.css';
</style>

但是卻提示報錯,

#
给我你的怀抱给我你的怀抱2711 天前652

全部回覆(3)我來回復

  • 黄舟

    黄舟2017-05-19 10:29:41

    你沒有設定正確的loader去載入字型

    回覆
    0
  • PHP中文网

    PHP中文网2017-05-19 10:29:41

    cnpm i --save-dev url-loader
    

    在webpack.config.js裡module.rules:輸入

          {
            test: /\.(eot|svg|ttf|woff|woff2)$/,
            loader:"url-loader",
            options: {
              name: '[name].[ext]?[hash]'
            }
          }

    重啟 npm run dev

    回覆
    0
  • 阿神

    阿神2017-05-19 10:29:41

    在 index.html 中使用 link 標籤就可以

    回覆
    0
  • 取消回覆