Skip to content

Commit

Permalink
fix(extend): 选择器 API 没有添加 '#' 开头,
Browse files Browse the repository at this point in the history
close #6871
  • Loading branch information
yuche authored and Chen-jj committed Jul 6, 2020
1 parent c2774b6 commit d9bda5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/taro-extend/src/jquery/zepto.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ export const Zepto = (function () {
if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0])) { return { top: 0, left: 0 } }
if (!isBrowser) {
return new Promise((resolve) => {
Taro.createSelectorQuery().select(this[0].uid).boundingClientRect(function (rect) {
Taro.createSelectorQuery().select('#' + this[0].uid).boundingClientRect(function (rect) {
resolve({
left: rect.left,
top: rect.top,
Expand Down Expand Up @@ -811,7 +811,7 @@ export const Zepto = (function () {
return Promise.resolve(hasScrollTop ? this[0].scrollTop : this[0].pageYOffset)
}
return hasScrollTop ? Promise.resolve(this[0].scrollTop) : new Promise((resolve) => {
Taro.createSelectorQuery().select(this[0].uid).scrollOffset(function (res) {
Taro.createSelectorQuery().select('#' + this[0].uid).scrollOffset(function (res) {
resolve(res.scrollTop)
}).exec()
})
Expand All @@ -829,7 +829,7 @@ export const Zepto = (function () {
}

return hasScrollLeft ? Promise.resolve(this[0].scrollLeft) : new Promise(resolve => {
Taro.createSelectorQuery().select(this[0].uid).scrollOffset(function (res) {
Taro.createSelectorQuery().select('#' + this[0].uid).scrollOffset(function (res) {
resolve(res.scrollLeft)
}).exec()
})
Expand Down

0 comments on commit d9bda5b

Please sign in to comment.