
Some checks are pending
Actions / Litemall-all (11) (push) Waiting to run
Actions / Litemall-all (11.0.3) (push) Waiting to run
Actions / Litemall-all (8) (push) Waiting to run
Actions / Litemall-all (8.0.192) (push) Waiting to run
Actions / Litemall-admin (10.x) (push) Waiting to run
Actions / Litemall-admin (12.x) (push) Waiting to run
Actions / Litemall-admin (14.x) (push) Waiting to run
Actions / Litemall-vue (10.x) (push) Waiting to run
Actions / Litemall-vue (12.x) (push) Waiting to run
Actions / Litemall-vue (14.x) (push) Waiting to run
23 lines
676 B
JavaScript
23 lines
676 B
JavaScript
export const basic = Behavior({
|
|
methods: {
|
|
$emit(...args) {
|
|
this.triggerEvent(...args);
|
|
},
|
|
getRect(selector, all) {
|
|
return new Promise(resolve => {
|
|
wx.createSelectorQuery()
|
|
.in(this)[all ? 'selectAll' : 'select'](selector)
|
|
.boundingClientRect(rect => {
|
|
if (all && Array.isArray(rect) && rect.length) {
|
|
resolve(rect);
|
|
}
|
|
if (!all && rect) {
|
|
resolve(rect);
|
|
}
|
|
})
|
|
.exec();
|
|
});
|
|
}
|
|
}
|
|
});
|