Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在骚乱中将键值与对象进行比较?我试图在 riot plee 建议中将键值与对象进行比较
首先你应该在你的问题中更明确......你想与对象比较什么键和值?为什么你需要 riot 才能做到这一点?
无论如何,您可以使用 lodash API 有效地比较对象。如果你真的需要 riot,你可以在 HTML 元素上使用 if 条件并使用函数或内联比较。
例如
<div if={ active: key === object }></div>
如果需要适当的答案,您应该更明确