初始化(包含登录模块)
This commit is contained in:
22
wxcomponents/vant/mixins/basic.js
Normal file
22
wxcomponents/vant/mixins/basic.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user