vue 中如何引入本地图片, 实现图片循环遍历 & 文字换行循环遍历 |
您所在的位置:网站首页 › js循环显示数组图片 › vue 中如何引入本地图片, 实现图片循环遍历 & 文字换行循环遍历 |
vue 中如何引入本地图片, 实现图片循环遍历 & 文字换行循环遍历 要实现图片的循环遍历, 1.在data中把图片的路径用数组组合而成。 比如 data(){ return { content_top:[ { title:‘图片1", src:’./imges/a.png’ key:‘0’}, { title:‘图片2", src:’./imges/b.png’,key:‘1’}, { title:‘图片3", src:’./imges/c.png’,key:‘2’} ]}} 图片的数据写好了,那么我们就需要在template模块中把数组遍历出来
{{contents.title}} 中实现不了 那么我们就想,有什么可以编译html的,想起了我们的v-html 所以只要![]() |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |