代码先锋网 代码片段及技术文章聚合

require图片报错Critical dependency: the request of a dependency is an expression

技术标签: 技术

 下面的实例会报错

Critical dependency: the request of a dependency is an expression

原因是,require传入一个变量

<template>
  <div>
    <img class="iframe" :src="require(url)" alt />
  </div>
</template>

<script>
export default {
  data () {
    return{
        url:'./img/img.jpg'
    }
  }
}
</script>

解决方法,用模板字符串

<img class="iframe" :src="require(`${url}`)" alt />

 

版权声明:本文为memoryI原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/memoryI/article/details/108279802

智能推荐

conda 安装模块报错:RemoveError: ‘requests‘ is a dependency of conda and cannot be removed from conda‘s ope

文章目录 今天突然使用conda进行安装一个模块,然后就报错: RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating enviro 然后网上都是升级conda解决的: 其实如果升级还保持,可以试试强制升级下: 我的是执行强制升级解...

dependency

需要使用哪些标签就要添加哪些jar包(动态web工程需要下载jar包,maven工程添加依赖(依赖都在MVN)) 例如: 1、junit 该依赖是针对于单元测试 junit junit 4.11 test 2、针对于servlet的依赖 javax.servlet javax.servlet-api 4.0.1 provided 3、针对标签库的依赖(JSTL java stantard tag ...

dependency

ib 指令 : 引入对应的标签库,用于使用一些标签 需要使用哪些标签就要添加哪些jar包(动态web工程需要下载jar包,maven工程添加依赖(依赖都在MVN)) 例如: 1、junit 该依赖是针对于单元测试 junit junit 4.11 test 2、针对于servlet的依赖 javax.servlet javax.servlet-api 4.0.1 provided 3、针对标签库的...

RemoveError: 'setuptools' is a dependency of conda and cannot be removed from conda's operating envi

今天用conda install 任何包都会出现这个错误: 参考网页: https://stackoverflow.com/questions/54392995/removeerror-requests-is-a-dependency-of-conda-and-cannot-be-removed-from-cond 方案一: 方案二: 方案三:...

RemoveError: 'requests' is a dependency of conda and cannot be removed

这个问题很简单,就是conda 的版本太旧了。有些pip安装的包有点小问题 解决方式也很简单,升级conda就行 然后再进行相关操作就行 ps,pip还经常提醒你要升级pip,这个conda从来都不提醒,还得遇到问题了百度才知道。ORZ...

猜你喜欢

RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating enviro

这个问题很简单,就是conda 的版本太旧了。有些pip安装的包有点小问题 解决方式也很简单,升级conda就行 然后再进行相关操作就行 ps,pip还经常提醒你要升级pip,这个conda从来都不提醒,还得遇到问题了百度才知道...

【解决问题】RemoveError: 'requests' is a dependency of conda and cannot be removed from....

在安装tensorflow的时候报错:RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating environment. 在查资料的过程中,大概有三种的解决方法: 说是conda版本太低 升级conda即可,即:conda updat...

RemoveError requests is a dependency of conda 问题解决

在执行conda命令时报错RemoveError: ‘requests’ is a dependency of conda and cannot be removed from conda’s operating environment. 按照网上的各种办法,包括执行 还是继续报错,经过多番尝试,在执行 之后,问题解决。      ...

解决RemoveError: "setuptools" is a dependency of conda and cannot be removed from conda

昨天将显卡驱动从389更新为418之后,无法创建新环境,且无法删除旧环境,使用conda remove或者conda create命令均会报错: RemoveError: ‘setuptools’ is a dependency of conda and cannot be removed from conda 查了一堆博客,都是建议更新conda。 输入命令conda u...

Android 使用Lottie的三个小技巧

Android 使用Lottie的三个小技巧 Shawn 文章目录 Android 使用Lottie的三个小技巧 I 开启硬件加速 II 通过添加AnimatorListener来控制动画行为 III 通过设置播放速度来实现动画倒放 I 开启硬件加速 开启硬件加速是个提升lottie动画表现效果的一个好办法,在我的老手机上,不开硬件加速就跟幻灯片一样. II 通过添加AnimatorListene...