是否可以将类表达式作为参数传递?还没有尝试过eval路线。// CardtsElements.Zone contains a valid class expression// used to create a valid Zone Custom Elementlet extend = (source, name, definitionClassExpression) => customElements.define('CARDTS-' + name, class extends CardtsElements[source] definitionClassExpression); ^^^^SYNTAX ERROR^^^^^^^^^^// Create a new 'CARDTS-FOUNDATION' element extending 'CARDTS-ZONE'extend('Zone','Foundation', { static get observedAttributes() { return ['suit','draggable','drop']; } constructor(){}});
添加回答
举报
0/150
提交
取消