vue :style设置背景图片方式backgroundImage

  mounted () {

  let imageName = 'mobile' //手机终端

  // 通过浏览器判断终端为手机(true) 或者 pc(false) 动态切换背景图片

  if (!this.$store.state.isMobile) {

  imageName = 'web' // pc 浏览器

  this.bacImage = {backgroundImage: 'url("https://rdet-oss-test.oss-cn-hangzhou.aliyuncs.com/admin/static/image/loginBackground.gif")'}

  }

  else {

  this.bacImage = {backgroundImage: 'url("https://rdet-oss-test.oss-cn-hangzhou.aliyuncs.com/admin/static/image/web_background.jpg")'}

  }

  },