diff --git a/components/back-top/__tests__/__snapshots__/demo.test.js.snap b/components/back-top/__tests__/__snapshots__/demo.test.js.snap
index d0d5d736e..26a2cc2a2 100644
--- a/components/back-top/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/back-top/__tests__/__snapshots__/demo.test.js.snap
@@ -1,9 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`renders ./components/back-top/demo/basic.vue correctly 1`] = ` Scroll down to see the bottom-right gray button.`;
+exports[`renders ./components/back-top/demo/basic.vue correctly 1`] = `
+
Scroll down to see the bottom-right gray button.
+`;
exports[`renders ./components/back-top/demo/custom.vue correctly 1`] = `
- Scroll down to see the bottom-right
blue button.
+
Scroll down to see the bottom-right
blue button.
`;
diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx
index 856f1cdf5..1e6f9c033 100644
--- a/components/back-top/index.tsx
+++ b/components/back-top/index.tsx
@@ -133,13 +133,14 @@ const BackTop = defineComponent({
},
};
- const backTopBtn = state.visible ? (
-
- {slots.default?.() || defaultElement}
-
- ) : null;
const transitionProps = getTransitionProps('fade');
- return {backTopBtn};
+ return (
+
+
+ {slots.default?.() || defaultElement}
+
+
+ );
};
},
});
diff --git a/components/back-top/style/index.ts b/components/back-top/style/index.tsx
similarity index 100%
rename from components/back-top/style/index.ts
rename to components/back-top/style/index.tsx