vue used in the project iconfont

A direct reference address

  1. iconfont my project was to generate addresses:

  2. Introducing the above address in index.html head
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_454988_dqx9pnwoxh7.css">
    <title>my</title>
  </head>
  <body>
    <div id="app"></div>
    <script>
      if (!!window.ActiveXObject || 'ActiveXObject' in window) {
        alert('本网站不支持任何版本的IE浏览器, 建议使用Chrome浏览器访问')
      }
    </script>
  </body>
</html>

This method is simple and quick, but it will depend on the external address of css, may cause system instability

II. The file is downloaded to the project iconfont

  1. Download and unzip the file

  2. The styles file decompression file copy into the project in, and renamed iconfont

  3. The introduction of the project (I introduced here in the styles of index.less)
@import "./font/iconfont.css";

This way each time you change the icon must re-download and replace the files in the project, the operation is relatively trouble some, but the fonts into their own projects, would be more stable and will not cause a problem can not be used because of other people's websites

Guess you like

Origin www.cnblogs.com/XHappyness/p/12517330.html