多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
>技术链:html+css+js+vue+vue-resource >API接口:https://douban.uieee.com/v2/movie/top250 >实现效果: ![](https://box.kancloud.cn/dea78a800be4571db10477de82dfa0eb_1616x670.gif) >html代码 ``` <div id="movie"> <ul> <li v-for="item in list"> <img v-bind:src="item.img" alt=""> <p>{{ item.title }}</p> </li> </ul> </div> ``` >css代码 ``` * { margin: 0; padding: 0; } #movie { width: 1200px; margin: 30px auto auto auto; } li { list-style-type: none; width: 200px; float: left; margin: 20px; } img { width: 100%; height: 280px; } ``` >js代码 ``` new Vue({ el: '#movie', data: { list: [] }, beforeCreate(){ var self = this; // var url = 'https://douban.uieee.com/v2/movie/top250' var url = 'https://douban.uieee.com/v2/movie/top250?start=0&count=40' this.$http.jsonp(url).then(res=>{ // console.log(res); let subjects = res.body.subjects; subjects.forEach(element => { let img = element.images.small; let title = element.title; let temp = {}; temp.img = img; temp.title = title; self.list.push(temp); }); }) } }) ``` --------- 整个项目以上传至[github](https://github.com/MrXuxu/H5_demo/tree/master/Vue%E9%A1%B9%E7%9B%AE)