我需要得到
class BoldBlot extends Inline {}
或者
class BoldBlot extends Inline {
static create(value) {
let node = super.create();
node.setAttribute('url', value);
return node;
}
static formats(node) {
return node.getAttribute('url');
}
}
但问题是如果我把 if 放在里面,class BoldBlot
它看不到 static ,如果我把它放在外面,class BoldBlot
它看不到自己BoldBlot
那我该怎么做呢?
↑相当于↓(*差不多,第一个没有原型)
因此有可能是这样的:
如果动作发生在某个函数内,您可以反之亦然,
if (!smth) return;并继续声明方法而无需额外的嵌套。