Skip to content

Commit

Permalink
fix(sticky): getCurrentInstance在computed中获取不到 (#1206)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoopZhou committed Jan 15, 2024
1 parent 3a8ccbd commit ced3cea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sticky/sticky.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default defineComponent({
props,
setup(props) {
const boxClasses = name;
const stickyContent = computed(() => renderContent(getCurrentInstance(), 'default', ''));
const internalInstance = getCurrentInstance();
const stickyContent = computed(() => renderContent(internalInstance, 'default', ''));
// box 用于占位和记录边界
// content 用于实际定位
const boxRef = templateRef<HTMLElement | null>('boxRef', null);
Expand Down

0 comments on commit ced3cea

Please sign in to comment.