Home  >  Q&A  >  body text

javascript - How to introduce boostrap.css and its font files into vue

I am in a.vue file

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

But it prompts an error,

给我你的怀抱给我你的怀抱2711 days ago647

reply all(3)I'll reply

  • 黄舟

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

    You have not configured the correct loader to load fonts

    reply
    0
  • PHP中文网

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

    cnpm i --save-dev url-loader
    

    Input module.rules: in webpack.config.js

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

    Restart npm run dev.

    reply
    0
  • 阿神

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

    Just use the link tag in index.html

    reply
    0
  • Cancelreply