vue2 相关

53 阅读1分钟

使用 vuedraggable 实现拖拽功能,因为集成到原项目中,性能较差 页面卡顿,所以需要新开一个页面,可解决页面卡顿问题

vue2 路由跳转打开一个新页面,跳转路由可以是子路由

window.open(this.$router.resolve({ name: 'applicationMenu',query: this.$route.query, }).href, '_blank');

若背景图正常请求,显示背景图,若是背景图请求失败,设置背景颜色

背景颜色设置
:style="{      backgroundImage: `url(${tabBar.bgImgUrl})`,      backgroundColor: imageLoaded ? 'transparent' : tabBar.bgColor    }"
背景图片加载是否成功标志
data(){
   imageLoaded: false,}
  mounted() {    const img = new Image();    img.onload = () => {      this.imageLoaded = true;    };    img.src = this.tabBar.bgImgUrl;  },