Best way to access adjacent components / fields

后端 未结 2 911
不思量自难忘°
不思量自难忘° 2021-01-18 03:08

I am looking for a way to access components / field that are either in the same items array as the accessing one or even only in a same parent items array (the last one is j

2条回答
  •  既然无缘
    2021-01-18 03:37

    Alternately, for your case of getting the next element in a container, you can use the nextSibling or prevSibling. All components have these methods. It would be a little less walking around the DOM structure. They also allow for a selector argument.

    They are described in the docs here.

提交回复
热议问题