因为vue是基于webpack开发的,webpack是一种模块化开发,因此在图片的引入时需要将图片作为模块去加载,利用require去引入图片
itemList: [
{
url: require("../../images/menu1.png"),
title: "新闻资讯",
to: "/newsList"
},
{
url: require("../../images/menu2.png"),
title: "图片分享",
to: "/photoList"
},
{
url: require("../../images/menu3.png"),
title: "商品购买",
to: "/goodList"
},
{
url: require("../../images/menu4.png"),
title: "留言反馈",
to: "/"
},
{
url: require("../../images/menu5.png"),
title: "视频专区",
to: "/"
},
{
url: require("../../images/menu6.png"),
title: "联系我们",
to: "/"
}
]
};
},