酶 .eq() 或 .index()?
Enzyme .eq() or .index()?
Enzyme 有一组类似 cheerio 的选择器函数,但它似乎没有 .eq()
或 .index()
。我在他们的文档中找不到它确实实现的一组超级特定的功能。
是否有类似 .eq()
或 .index()
的函数可用于获取特定索引处的特定元素。
:nth-child()
似乎没有实现,.get()
展开它,我不是特别想要。
您正在寻找 .at()
Returns a wrapper around the node at a given index of the current wrapper.
Enzyme 有一组类似 cheerio 的选择器函数,但它似乎没有 .eq()
或 .index()
。我在他们的文档中找不到它确实实现的一组超级特定的功能。
是否有类似 .eq()
或 .index()
的函数可用于获取特定索引处的特定元素。
:nth-child()
似乎没有实现,.get()
展开它,我不是特别想要。
您正在寻找 .at()
Returns a wrapper around the node at a given index of the current wrapper.