问题
I'm building a plugin in Adobe XD. Can I use ES2015+ (ES6) features? For example, template literals, let
, const
, Arrow functions, asynchronous functions ( async / await )?
回答1:
XD plugin APIs support most of ES2015 and beyond. You can use features such as:
- Template literals
- Classes
- Block-scoped variables (
let
,const
) - Object destructuring
- Default parameters
- Spread and Rest (
...
) - Arrow functions
- Asynchronous functions (
async
/await
) - Promises
You can also use ES5 JavaScript features as well.
The XD plugin API docs have a page on JavaScript support.
来源:https://stackoverflow.com/questions/53213787/can-you-use-es2015-features-es6-in-adobe-xd-plugins