亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

bootstrap的輪播,vue綁定數據?

bootstrap的輪播,vue綁定數據?

Zoe_z 2018-05-28 21:41:30
一開始用bootstrap來實現靜態的輪播,現在用vue來綁定之后,輪播就動不了?<div class="section" id="sj"> ????<div v-for="r in datas" class="section content" :id="r.autoid"> ????????<div id="carousel-example-generic section " class="carousel slide" data-ride="carousel"> ?????????????<!-- Indicators -->???????????? <ol class="carousel-indicators">???????????????? <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>???????????????? <li data-target="#carousel-example-generic" data-slide-to="1"></li>???????????????? <li data-target="#carousel-example-generic" data-slide-to="2"></li>???????????????? <li data-target="#carousel-example-generic" data-slide-to="3"></li>???????????? </ol>???????????? <!-- Wrapper for slides -->???????????? <div class="carousel-inner section" role="listbox" >???????????????? <div class="item active"><img :src="'images/sj/'+r.photo1+'.jpg'" alt="..."></div>???????????????? <div class="item "><img :src="'images/sj/'+r.photo2+'.jpg'" alt="..."></div>???????????????? <div class="item "><img :src="'images/sj/'+r.photo3+'.jpg'" alt="..."></div>???????????????? <div class="item "><img :src="'images/sj/'+r.photo4+'.jpg'" alt="..."></div>???????????? ? </div> ????????</div>????</div></div>js:$(function(){???? var vmm = new Vue({???????? el:"#sj",???????? data:{???????? datas:[]???????? },???????? mounted:function(){???????? this.showData();???????? this.showCar();???????? },???????? methods:{???????? showData:function(){???????? $.ajax({???????????? type:'get',???????????? url:'../wxk.json',???????????? dataType:'json',???????????? success:function(data){???????????? for(var i=0;i<data.sjList.length;i++){???????????????? if(sjid == data.sjList[i].autoid){???????????????? ???? vmm.datas.push(data.sjList[i]);???????????????? }???????????? }???????????? }?????????? });???????? },???????? showCar:function(){???????? //輪播???????? $(".carousel").swipe({???????? swipeLeft: function() { $(this).carousel('next'); },???????? swipeRight: function() { $(this).carousel('prev'); },???????? });???????? }???? } });
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 2526 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號