diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx
index 4587ff391..4a60eb3d4 100644
--- a/components/anchor/Anchor.tsx
+++ b/components/anchor/Anchor.tsx
@@ -238,7 +238,7 @@ export default defineComponent({
});
const anchorClass = classNames(pre, {
- fixed: !affix && !showInkInFixed,
+ [`${pre}-fixed`]: !affix && !showInkInFixed,
});
const wrapperStyle = {
diff --git a/components/anchor/__tests__/__snapshots__/demo.test.js.snap b/components/anchor/__tests__/__snapshots__/demo.test.js.snap
index 8889baaff..a06050b82 100644
--- a/components/anchor/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/anchor/__tests__/__snapshots__/demo.test.js.snap
@@ -31,7 +31,7 @@ exports[`renders ./components/anchor/demo/basic.vue correctly 1`] = `
exports[`renders ./components/anchor/demo/customizeHighlight.vue correctly 1`] = `
-
+
Basic demo
@@ -53,7 +53,7 @@ exports[`renders ./components/anchor/demo/customizeHighlight.vue correctly 1`] =
exports[`renders ./components/anchor/demo/onChange.vue correctly 1`] = `
-
+
Basic demo
@@ -75,7 +75,7 @@ exports[`renders ./components/anchor/demo/onChange.vue correctly 1`] = `
exports[`renders ./components/anchor/demo/onClick.vue correctly 1`] = `
-
+
Basic demo
@@ -97,7 +97,7 @@ exports[`renders ./components/anchor/demo/onClick.vue correctly 1`] = `
exports[`renders ./components/anchor/demo/static.vue correctly 1`] = `
-
+
Basic demo
diff --git a/components/anchor/style/index.less b/components/anchor/style/index.less
index 347bc9141..31ef624d9 100644
--- a/components/anchor/style/index.less
+++ b/components/anchor/style/index.less
@@ -47,7 +47,7 @@
}
}
- &.fixed &-ink &-ink-ball {
+ &-fixed &-ink &-ink-ball {
display: none;
}