Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(extend): 选择器 API 没有添加 '#' 开头, #6884

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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