订单
This commit is contained in:
30
node_modules/uview-ui/libs/mixin/mixin.js
generated
vendored
Normal file
30
node_modules/uview-ui/libs/mixin/mixin.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
onLoad() {
|
||||
// getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
|
||||
this.$u.getRect = this.$uGetRect
|
||||
},
|
||||
methods: {
|
||||
// 查询节点信息
|
||||
$uGetRect(selector, all) {
|
||||
return new Promise(resolve => {
|
||||
uni.createSelectorQuery().
|
||||
in(this)[all ? 'selectAll' : 'select'](selector)
|
||||
.boundingClientRect(rect => {
|
||||
if (all && Array.isArray(rect) && rect.length) {
|
||||
resolve(rect)
|
||||
}
|
||||
if (!all && rect) {
|
||||
resolve(rect)
|
||||
}
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
uni.$emit('uOnReachBottom')
|
||||
}
|
||||
}
|
||||
13
node_modules/uview-ui/libs/mixin/mpShare.js
generated
vendored
Normal file
13
node_modules/uview-ui/libs/mixin/mpShare.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
onLoad() {
|
||||
// 设置默认的转发参数
|
||||
this.$u.mpShare = {
|
||||
title: '', // 默认为小程序名称
|
||||
path: '', // 默认为当前页面路径
|
||||
imageUrl: '' // 默认为当前页面的截图
|
||||
}
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.$u.mpShare
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user