project init
This commit is contained in:
@@ -160,18 +160,20 @@ let Tabs = class Tabs extends SuperComponent {
|
||||
return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
|
||||
}
|
||||
getTrackSize() {
|
||||
// return new Promise((resolve) => {
|
||||
// if (this.trackWidth) {
|
||||
// resolve(this.trackWidth);
|
||||
// return;
|
||||
// }
|
||||
// getRect(this, `.${prefix}-tabs__track`).then((res) => {
|
||||
// if (res) {
|
||||
// this.trackWidth = res.width;
|
||||
// resolve(this.trackWidth);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
return new Promise((resolve) => {
|
||||
if (this.trackWidth) {
|
||||
resolve(this.trackWidth);
|
||||
return;
|
||||
}
|
||||
getRect(this, `.${prefix}-tabs__track`).then((res) => {
|
||||
if (res) {
|
||||
this.trackWidth = res.width;
|
||||
resolve(this.trackWidth);
|
||||
}
|
||||
}).catch(reason => {
|
||||
console.log(reason)
|
||||
});
|
||||
});
|
||||
}
|
||||
setTrack() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
||||
Reference in New Issue
Block a user