引入vue.js后,如图红框部分的左右滑动失效了,有遇到过的吗,或者有什么解决办法
- 发布:2015-11-19 20:00
- 更新:2018-12-22 01:41
- 阅读:17339
mingtianfu (作者)
<div class="mui-content" id="app">
<div id="slider" class="mui-slider mui-fullscreen">
<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<div class="mui-scroll" v-if="!loading">
<a v-repeat="item in items.mall_type" v-class="mui-control-item:true,mui-active:$index==0" href="#item{{$index+1}}mobile" v-on="tap:getData($index)">
{{item}}
</a>
</div>
</div>
<div class="mui-slider-group">
<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
<div id="scroll1" class="mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view">
<li v-repeat="item in items.malls" class="mui-table-view-cell">
{{item.title}}
</li>
</ul>
</div>
</div>
</div>
<div id="item2mobile" class="mui-slider-item mui-control-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
第2个选项卡子项-1
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/mui.min.js"></script>
<script src="js/mui.pullToRefresh.js"></script>
<script src="js/mui.pullToRefresh.material.js"></script>
<script type="text/javascript" src="js/vue.min.js"></script>
<script type="text/javascript" src="js/mall.js"></script>
mingtianfu (作者)
上面是html代码,下面的自带的js我没有动过,就不贴了
我的mall.js里面代码是
var burl = "http://wxtp.jayanbo.com/index.php";
au("ajax", "mall", "", "#app");
function au(mod, act, cid, el) {
var data = mui.ajax(burl, {
data: {
mod: mod,
act: act,
cid: cid
},
dataType: 'json', //服务器返回json格式数据
type: 'get', //HTTP请求类型
success: function(data) {
//获得服务器响应
console.log(JSON.stringify(data.mall_type));
var items = data;
var app = new Vue({
el: el,
data: {
items: items,
loading: false
},
// 在 `methods` 对象中定义方法
methods: {
getData: function(index, event) {
// 方法内 `this` 指向 vm
alert(index);
}
}
})
}
});
}
typer - 90后ITboy
vue结合mui时的正确使用方式(至少我遇到的slider无法滑动的问题正常了):https://blog.csdn.net/a8725585/article/details/72152264
古芗
题主红框内,是需要调用什么组件? 我在vue 的nextTick回调里 调用了 mui().scroll() 组件,无效!
2017-05-18 11:28
特洛伊
var vm = new Vue({...}); vue实例要命名在plusready之外! 然后在ajax获得数据后,调用vm.$nextTick(),在回调函数里初始化组件!
2018-08-31 14:09
特洛伊
我发起了一个经验:http://ask.dcloud.net.cn/article/34973 具体的你可以看看
2018-08-31 14:17