Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sticky] 只能针对浏览器窗口进行定位 #1087

Closed
beloved-zh opened this issue Sep 14, 2023 · 1 comment · Fixed by #1103
Closed

[Sticky] 只能针对浏览器窗口进行定位 #1087

beloved-zh opened this issue Sep 14, 2023 · 1 comment · Fixed by #1103
Labels
enhancement New feature or request issueshoot 代码共建平台 middle 中等问题

Comments

@beloved-zh
Copy link

beloved-zh commented Sep 14, 2023

tdesign-mobile-vue 版本

1.0.3

重现链接

No response

重现步骤

script setup lang="ts">
  function onScroll(context: { scrollTop: number; isFixed: boolean }) {
    console.log(context)
  }
</script>

<template>
  <div style="height: 200px" />
  <div id="container" class="sticky-demo">
    <div v-for="item in 40" :key="item">
      {{ item }}
    </div>
    <t-sticky container="container" :z-index="1000000" @scroll="onScroll">
      <t-button size="large" class="common-button green-button">
        指定容器
      </t-button>
    </t-sticky>
    <div v-for="item in 40" :key="item">
      {{ item }}
    </div>
  </div>
</template>

<style lang="less" scoped>
.sticky-demo {
  overflow: scroll;
  width: 100%;
  height: 400px;
  background-color: rgb(255 255 255 / 100%);
}

.common-button {
  margin-left: 256px;
  width: 104px;
  color: #ffffff;
}

.green-button {
  color: #ffffff;
  background-color: rgb(0 168 112 / 100%);
}
</style>

期望结果

可以指定父元素进行吸顶

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

IssueShoot

  • 预估时长: 3
  • 期望完成时间: 2023-09-21 00:00:00 +0000 UTC
  • 开发难度: 中
  • 参与人数: 1
  • 验收标准: 实现期望改造效果,提 PR 并通过验收无误
  • 备注: 最终激励以实际提交 pull request 并合并为准
@github-actions
Copy link
Contributor

👋 @beloved-zh,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@anlyyao anlyyao added enhancement New feature or request issueshoot 代码共建平台 middle 中等问题 labels Sep 14, 2023
demoadminjie added a commit to demoadminjie/tdesign-mobile-vue that referenced this issue Sep 18, 2023
anlyyao pushed a commit that referenced this issue Sep 19, 2023
* fix: (Sticky) 只能针对浏览器窗口进行定位(#1087)

* fix: 升级@vueuse/core,并改正误引入和升级后的异常

* fix: 修复sticky.vue中的eslint错误
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request issueshoot 代码共建平台 middle 中等问题
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants