Skip to content

Commit

Permalink
Slider 组件的默认tooltip提示主题修改 (#424)
Browse files Browse the repository at this point in the history
* fix(slider): fix: fix slider tooltip default theme

Slider 组件使用tooltip背景颜色统一

* chore: 删除注释代码
  • Loading branch information
LuckyWinty authored Feb 18, 2022
1 parent 36774ca commit 3c1cd76
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 55 deletions.
24 changes: 10 additions & 14 deletions src/slider/slider-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { Styles } from '@src/common';
import { prefix } from '../config';
import Slider from './slider';
import Popup from '../popup/popup';
import Tooltip from '../tooltip/index';
import { getIEVersion } from '../_common/js/utils/helper';
import { TdSliderProps } from './type';
import { TdTooltipProps } from '../tooltip/type';

const name = `${prefix}-slider-button`;
interface SliderInstanceType extends Vue {
Expand Down Expand Up @@ -128,6 +130,12 @@ export default (Vue as VueConstructor<SliderInstanceType>).extend({
}
}
},
getTooltipProps(): TdTooltipProps {
if (this.tooltipProps instanceof Object) {
return this.tooltipProps;
}
return {};
},
handleIE() {
if (getIEVersion() <= 11) {
this.$nextTick(() => {
Expand Down Expand Up @@ -300,21 +308,9 @@ export default (Vue as VueConstructor<SliderInstanceType>).extend({
onblur={this.handleMouseLeave}
onKeydown={this.onNativeKeyDown}
>
<t-popup
ref="popup"
popper-class={this.popupClass}
disabled={!this.showTooltip}
content={String(this.formatValue)}
placement={this.placement}
trigger={this.trigger}
showArrow={this.showArrow}
overlayStyle={this.overlayStyle}
overlayClassName={this.overlayClassName}
attach={this.attach}
visible={this.visible}
>
<Tooltip props={this.getTooltipProps()} content={String(this.formatValue)}>
<div class={[`${prefix}-slider__button`, { [`${prefix}-slider__button--dragging`]: this.dragging }]} />
</t-popup>
</Tooltip>
</div>
);
},
Expand Down
1 change: 0 additions & 1 deletion src/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export default Vue.extend({
return (
<Popup
visible={this.visible}
showArrow={this.showArrow}
props={this.getPopupProps()}
on={{
'visible-change': this.onTipVisibleChange,
Expand Down
Loading

0 comments on commit 3c1cd76

Please sign in to comment.