You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
1.6 KiB

const allConfig = {};
const allFunc = {};
/**
* 自动下拉刷新
*/
allConfig.common = {
downOption: {
auto: true,
use: true
},
upOption: {
page: {
size: 10 // 每页数据的数量,默认10
},
auto: false,
toTop: {
src: 'https://shidaizhu.oss-cn-shenzhen.aliyuncs.com/app_static/images/backtop.png',
bottom: "20%",
duration: 300,
zIndex: 9990,
right: 50,
safearea: false,
width: 96,
radius: "50%",
left: null
},
empty: {
use: true,
// icon: require('@/static/zichan_empty.png'),
tip: '暂无数据',
// btnText: '发布项目需求',
fixed: false,
top: '40%',
zIndex: 9
},
mescroll: null,
noMoreSize: 5,
textNoMore: '-- 暂无更多数据 --'
}, // 上拉加载的常用配置
};
allFunc.common = {
computed:{
$mTop(){
return this.$n.state.$Top
},
},
onPageScroll(e) {
// if(e.scrollTop<=40){
// this.mescroll.lockDownScroll( false )
// }
// if(e.scrollTop>40){
// this.mescroll.lockDownScroll( true )
// }
},
mounted(){
},
methods: {
mescrollInit(mescroll) {
this.mescroll = mescroll;
},
// mescroll组件初始化的回调,可获取到mescroll对象
downCallback(mescroll) {
this.mescroll.resetUpScroll(false)
},
upCallback(mescroll) {
},
}
}
export default function(name,func="common") {
const config = allConfig[name] ? allConfig[name] : {}
const myFunc = allFunc[func] ? allFunc[func] : {}
return {
data() {
return {
downOption: {}, // 下拉刷新的配置
upOption: {}, // 上拉加载的常用配置
...config,
}
},
...myFunc
}
}