Skip to content

[sticky] props.container类型设置与实际代码使用不符,导致控制台报错 #2115

@wocient

Description

@wocient

tdesign-mobile-vue 版本

1.12.1

重现链接

No response

重现步骤

container属性设置为Element类型(API和ts定义也写的Element)。

  <div ref="headerRef" class="header"></div>
  <t-sticky :container="headerRef">
    <div>头部粘性</div>
  </t-sticky>

期望结果

正常运行

实际结果

报错,不支持API所描述类型

Image

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

containe实际是需要传String类型直接用于document.querySelector,传Object会报错,但传String又会报warning。
希望统一API和属性定义,避免误解。

Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions