因为vue是基于webpack开发的,webpack是一种模块化开发,因此在图片的引入时需要将图片作为模块去加载,利用require去引入图片

    1. itemList: [
    2. {
    3. url: require("../../images/menu1.png"),
    4. title: "新闻资讯",
    5. to: "/newsList"
    6. },
    7. {
    8. url: require("../../images/menu2.png"),
    9. title: "图片分享",
    10. to: "/photoList"
    11. },
    12. {
    13. url: require("../../images/menu3.png"),
    14. title: "商品购买",
    15. to: "/goodList"
    16. },
    17. {
    18. url: require("../../images/menu4.png"),
    19. title: "留言反馈",
    20. to: "/"
    21. },
    22. {
    23. url: require("../../images/menu5.png"),
    24. title: "视频专区",
    25. to: "/"
    26. },
    27. {
    28. url: require("../../images/menu6.png"),
    29. title: "联系我们",
    30. to: "/"
    31. }
    32. ]
    33. };
    34. },

    image.png