gpt4 book ai didi

javascript - polymer 构建 : Warning [unknown-superclass] - Unable to resolve superclass superClass

转载 作者:行者123 更新时间:2023-12-03 09:40:58 26 4
gpt4 key购买 nike

尝试构建我的 Polymer 2.0 项目,但每次我尝试时,无论预设(es5-bundled、es6-bundled)还是单独的标志,我都会收到以下针对我拥有的一个 mixin 的警告:

EdmMac: public vedtam$ polymer build
info: Clearing build/ directory...
info: (default) Building...

const DatastoreMixin = (superClass) => class extends superClass {
~~~~~~~~~~
src/mixins/datastore-mixin.html(1,57) warning [unknown-superclass] - Unable to resolve superclass superClass
info: (default) Build complete!

构建对象:

  "builds": [{
"name": "default",
"bundle": true,
"js": {"compile": true},
"css": {"minify": true},
"html": {"minify": true},
"addServiceWorker": true
}]

调用者:app-main.html:

class MyApp extends Polymer.GestureEventListeners(DatastoreMixin(ReduxMixin(Polymer.Element))) {

数据存储混合器:

<script>
DatastoreMixin = function(superClass) {
return class extends superClass {
constructor() {
super();
}

static get properties() {
return {
bar: {
type: Object
}
};
}

}
}
</script>

版本与环境

  • Polymer CLI:1.1.0
  • 节点:v6.10.3
  • 操作系统:OSX 10.10.5

有什么问题吗?

最佳答案

如果有人遇到同样的问题,我从 Polymer 开发人员那里得到了答案,作为修复你需要使用 /* @polymerMixin */ 注释:

<script>
/* @polymerMixin */
DatastoreMixin = function(superClass) {
return class extends superClass {
constructor() {
super();
}

static get properties() {
return {
bar: {
type: Object
}
};
}

}
}
</script>

关于javascript - polymer 构建 : Warning [unknown-superclass] - Unable to resolve superclass superClass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44935629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com