• vue——引入字体


    效果:

                                                未引入                                                                                                                             引入后

                                     

    我想引入的字体是"din-bold_",首先在assets下新建一文件夹"font"(其他位置也行,根据喜好习惯即可),将字体文件"din-bold_.otf"放入,接下来在需要引入的组件中引入即可。

    vue:

    <template>
      <div class="hello">
          <div class="menu-container" ref="menuContainer">
            1234567890
          </div>
      </div>
    </template>
    
    <script>
      export default {
        name: 'HelloWorld',
        data() {
          return {}
        }
      }
    </script>
    
    <style scoped>
      body {
        font-family: 'Avenir', Helvetica, Arial, sans-serif;
      }
    
      .hello,
      .wrapper,
      .menu-container {
         100%;
        height: 100%;
        font-family: din-bold;
      }
    
      @font-face {
        font-family: din-bold; //自定义字体名称
        src: url('../assets/font/din-bold_.otf'); //注意引入正确位置
      }
    </style>

      

  • 相关阅读:
    CSUOJ 1081 集训队分组
    HDU 1865 More is Better
    HDU 1325 Is It A Tree?
    HDU 1272 小希的迷宫
    CSUOJ 1217 奇数个的那个数
    CSUOJ 1010 Water Drinking
    CSUOJ 1162 病毒
    CodeForces 295B
    CodeForces 20C
    SPOJ MULTQ3
  • 原文地址:https://www.cnblogs.com/linjiangxian/p/12622772.html
Copyright © 2020-2023  润新知