webpack4-vue2-multiPage icon indicating copy to clipboard operation
webpack4-vue2-multiPage copied to clipboard

build 后在 style 中和 template 中图片路径不一致

Open MrTreasure opened this issue 6 years ago • 0 comments

对于在 assets 下的图片 assets/img/logo.png

<template>
  <img src="~@asssets/img/logo.png"/>
  <div class="bg"></div>
</template>

<script>
</script>

<style>
  .div {
    width: 200px;
    height: 200px;
    background-url: url('~@assets/img/logo.png');
  }
</style>

前者打包输出的引用路径为 /img/logo.82b9c7a5.png 后者打包输出的引用路径为 /css/img/logo.82b9c7a5.png

MrTreasure avatar Feb 17 '19 05:02 MrTreasure