Skip to content

Commit

Permalink
fix(progress): 移除getInnerDiameter() 并改使用heightBar
Browse files Browse the repository at this point in the history
  • Loading branch information
hxh committed Sep 11, 2024
1 parent b564c03 commit 24ecbb6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions src/progress/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ export default class Progress extends SuperComponent {
});
},

theme(theme) {
if (theme === 'circle') {
this.getInnerDiameter();
}
},

trackColor(trackColor) {
this.setData({
Expand All @@ -80,17 +75,4 @@ export default class Progress extends SuperComponent {
},
};

methods = {
getInnerDiameter() {
const { strokeWidth } = this.properties;
const wrapID = `.${name}__canvas--circle`;
if (strokeWidth) {
getRect(this, wrapID).then((wrapRect) => {
this.setData({
innerDiameter: wrapRect.width - unitConvert(strokeWidth) * 2,
});
});
}
},
};
}
2 changes: 1 addition & 1 deletion src/progress/progress.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
>
<view
class="{{classPrefix}}__canvas--inner {{prefix}}-class-bar"
style="{{innerDiameter? 'width:'+ innerDiameter*2 + 'rpx;' + 'height:'+ innerDiameter*2 + 'rpx;': ''}}"
style="{{heightBar? '--td-progress-stroke-circle-width:' + heightBar + 'px' : ''}}"
>
<view wx:if="{{label}}" class="{{classPrefix}}__info {{prefix}}-class-label" aria-hidden="{{ true }}">
<template
Expand Down

0 comments on commit 24ecbb6

Please sign in to comment.