我有一个.vue文件想要使用内联样式
<img src="~static/img/info/production/pic4.jpg" class="t22" />
<a href="/page/fresco-art" class="btn t23">First text</a>
<div class="hr t24"></div>
<h2 class="t25">Second text</h2>
<ul class="services">
<li :style="{ backgroundImage: `url('~static/img/info/production/pic5.jpg')` }" class="sq">
<div class="n">Third text</div>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
使用标签的图像<img>可以正确显示,但background-image在标签中<li>则无法正确显示。
如何正确指定文件路径?