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.
我学jquery时间不长。请帮助将变量而不是对象方法。
return { label: item.MYVariable, }
我需要而不是MYVariable放置动态变量。
MYVariable
假设我正确理解了您的问题,您可以使用括号表示法来访问变量,如下所示:
var foo = 'MYVariable'; return { label: item[foo]; }