1234567891011121314151617181920212223242526272829 |
- export default Behavior({
- methods: {
- gettingBoundingClientRect(selector, all) {
- return new Promise((resolve, reject) => {
- try {
- wx.createSelectorQuery()
- .in(this)[all ? 'selectAll' : 'select'](selector)
- .boundingClientRect((rect) => {
- if (all && Array.isArray(rect) && rect.length) {
- resolve(rect);
- }
- else if (!all && rect) {
- resolve(rect);
- }
- else {
- reject();
- }
- })
- .exec();
- }
- catch (err) {
- reject(err);
- }
- });
- },
- },
- });
- //# sourceMappingURL=dom.js.map
|