有人能说清楚我从StandardJS回来的通知吗?
解析错误:意外的令牌=
代码如下:
export default class foreignDataFormat extends _base {
static input = class ForeignDataFormatInput extends React.Component {
render () {
}
}
}
错误是指第二行input = class
在JavaScript中,类不能定义为静态。但方法可以定义为静态。你只需定义(也可能意味着定义)类,如:
export default class foreignDataFormat extends _base {
const input = class ForeignDataFormatInput extends React.Component {
static myMethod() {
//... my static method
}
render () {
}
}
}
您可能有兴趣看到this post。