文件查找失败:'@/static/images/ranking-${this.ranking}.png'
来源:5-26 List 组件 - 渲染真实数据

新新天空
2023-01-10
${this.ranking} 识别为字符了,这是为什么?
但使用这种写法是可以。
return require(’@/static/images/ranking-’ + this.ranking + ‘.png’);
写回答
1回答
-
你好
你应该使用模板字符串,也就是 `` 符号,而不是单引号
012023-01-11
相似问题