vue项目在ie浏览器上要注意的问题

1. 动态设置背景图片
不显示图片的代码

<div class="photoBox" v-show="!ifCircle" :style="{backgroundImage:'url('+ info.avatar}"></div>

修改之后可以正常显示的代码,至于原因我也不知道

<div class="photoBox" :style="note"></div>

data () {
    
    
    return {
    
    
      note:{
    
    
        backgroundImage: "url(" + Cookies.get('webuseravatar') + ")",
      }
    }
  1. 引入的外部字体在ie上报错,因为ie9以上只支持eot的字体,所以引入字体的时候要引入多个url
@font-face {
    
     
  font-family: 'DIN-Bold'; 
  src:url('DIN-Condensed-Bold.ttf'); 
  src:url('DIN-Condensed-Bold.eot?#iefix') format('DIN-Condensed-Bold.woff') format('woff'),
      url('DIN-Condensed-Bold.ttf') format('truetype'),
      url('DIN-Condensed-Bold.svg#webfontOTINA1xY') format('svg');
  font-weight: normal; 
  font-style: normal; 
}

猜你喜欢

转载自blog.csdn.net/weixin_44994372/article/details/102853957