收藏
回答

父组件无法使用IntersectionObserver观察子组件里的元素吗?

如图,在父组件创建IntersectionObserver,然后用深度选择子组件里的元素提示 " [pages/index/index] Node \"/deep/.topic-cont\" is not found. Intersection observer will not trigger. "

回答关注问题邀请回答
收藏

2 个回答

  • brave
    brave
    2022-01-26

    仅支持下列语法:

    ID选择器:#the-id

    class选择器(可以连续指定多个):.a-class.another-class

    子元素选择器:.the-parent > .the-child

    后代选择器:.the-ancestor .the-descendant

    跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant

    多选择器的并集:#a-node, .some-other-nodes

    2022-01-26
    有用 1
    回复 4
    • ZwyOo
      ZwyOo
      2022-01-26
      使用了>>>还是选不到
      2022-01-26
      回复
    • 肖荣豪
      肖荣豪
      2022-04-20
      啊这,选择器还是错误的
      2022-04-20
      回复
    • 花开富贵
      花开富贵
      2023-09-13回复肖荣豪
      [pages/home/home] Node \".position >>> .item\" is not found. Intersection observer will not trigger.选不到子组件里面啊
      2023-09-13
      回复
    • 花开富贵
      花开富贵
      2023-09-13
      [pages/home/home] Node \".position >>> .item\" is not found. Intersection observer will not trigger.选不到子组件里面啊
      2023-09-13
      回复
  • 微盟
    微盟
    2022-01-30

    这个选择器语法不对吧

    /deep/.topic-cont
    
    2022-01-30
    有用
    回复
登录 后发表内容