mui和vue(vue-resourse)组合使用实例上拉加载
0
mui.init();
(function($) {
//阻尼系数
var deceleration = mui.os.ios?0.003:0.0009;
$('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条
deceleration:deceleration
});
$.ready(function() {
//循环初始化所有下拉刷新,上拉加载。
$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
$(pullRefreshEl).pullToRefresh({
up: {
callback: function() {
Vue.component;
var self = this;
setTimeout(function() {
Vue.component('tie-app', {//要应用的标签
template: '#tie-template',//模板id
props: ['list']//请求的json
})
var demo = new Vue({
el: '#app',
data: {
ties: '' //为空,可以是null
},
ready: function() {
this.getCustomers()
},
methods: {
getCustomers: function() {
this.$http.get('json/homeList0.json')
.then(function(response) { //response传参,可以是任何值
this.$set('ties', response.data)
})
.catch(function(response) {
console.log(response)
})
}
}
})
}, 1000);
}
}
});
});
});
})(mui);