Skip to content

Commit 96299c5

Browse files
committed
fix: anchor fixed less #4931
close #4931
1 parent cf4ab54 commit 96299c5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

components/anchor/Anchor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export default defineComponent({
238238
});
239239

240240
const anchorClass = classNames(pre, {
241-
fixed: !affix && !showInkInFixed,
241+
[`${pre}-fixed`]: !affix && !showInkInFixed,
242242
});
243243

244244
const wrapperStyle = {

components/anchor/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ exports[`renders ./components/anchor/demo/basic.vue correctly 1`] = `
3131

3232
exports[`renders ./components/anchor/demo/customizeHighlight.vue correctly 1`] = `
3333
<div class="ant-anchor-wrapper" style="max-height: 100vh;">
34-
<div class="ant-anchor fixed">
34+
<div class="ant-anchor ant-anchor-fixed">
3535
<div class="ant-anchor-ink"><span class="ant-anchor-ink-ball visible" style="top: -4.5px;"></span></div>
3636
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-basic" title="Basic demo">Basic demo</a>
3737
<!---->
@@ -53,7 +53,7 @@ exports[`renders ./components/anchor/demo/customizeHighlight.vue correctly 1`] =
5353

5454
exports[`renders ./components/anchor/demo/onChange.vue correctly 1`] = `
5555
<div class="ant-anchor-wrapper" style="max-height: 100vh;">
56-
<div class="ant-anchor fixed">
56+
<div class="ant-anchor ant-anchor-fixed">
5757
<div class="ant-anchor-ink"><span class="ant-anchor-ink-ball"></span></div>
5858
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-basic" title="Basic demo">Basic demo</a>
5959
<!---->
@@ -75,7 +75,7 @@ exports[`renders ./components/anchor/demo/onChange.vue correctly 1`] = `
7575

7676
exports[`renders ./components/anchor/demo/onClick.vue correctly 1`] = `
7777
<div class="ant-anchor-wrapper" style="max-height: 100vh;">
78-
<div class="ant-anchor fixed">
78+
<div class="ant-anchor ant-anchor-fixed">
7979
<div class="ant-anchor-ink"><span class="ant-anchor-ink-ball"></span></div>
8080
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-basic" title="Basic demo">Basic demo</a>
8181
<!---->
@@ -97,7 +97,7 @@ exports[`renders ./components/anchor/demo/onClick.vue correctly 1`] = `
9797

9898
exports[`renders ./components/anchor/demo/static.vue correctly 1`] = `
9999
<div class="ant-anchor-wrapper" style="max-height: 100vh;">
100-
<div class="ant-anchor fixed">
100+
<div class="ant-anchor ant-anchor-fixed">
101101
<div class="ant-anchor-ink"><span class="ant-anchor-ink-ball"></span></div>
102102
<div class="ant-anchor-link"><a class="ant-anchor-link-title" href="#components-anchor-demo-basic" title="Basic demo">Basic demo</a>
103103
<!---->

components/anchor/style/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848
}
4949

50-
&.fixed &-ink &-ink-ball {
50+
&-fixed &-ink &-ink-ball {
5151
display: none;
5252
}
5353

0 commit comments

Comments
 (0)