<script>
    import img_index_path from '../../assets/img/index_1.png';
    import img_myself_path from '../../assets/img/myself_0.png';

    // 输出的路径是变化的:“/img/index_1.68c713f2.png”
    // 所以说导入图片路径不能用字符串变量方式来传递参数,必须import导入图片!
    console.log( img_index_path );

    export default {
        name: 'footer',
        data () {
            return {
                img_index_path: img_index_path,
                img_myself_path: img_myself_path
            };
        }

    };
</script>

Vue之ES6的import导入图片路径用法

相关文章:

  • 2021-11-20
  • 2021-11-22
  • 2021-06-30
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-11-21
  • 2021-12-22
  • 2021-05-31
  • 2022-12-23
  • 2021-08-13
相关资源
相似解决方案