尝试构建我的聚合物2.0项目,但每次我尝试无论预设(es5-bundled,es6-bundled)还是单独的标志,我都会收到以下警告:
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))) {
DatastoreMixin:
<script>
DatastoreMixin = function(superClass) {
return class extends superClass {
constructor() {
super();
}
static get properties() {
return {
bar: {
type: Object
}
};
}
}
}
</script>
可能出现什么问题?
答案 0 :(得分:7)
如果有人遇到同样的问题,我得到了Polymer devs的回答,作为修复,您需要使用/* @polymerMixin */
注释:
<script>
/* @polymerMixin */
DatastoreMixin = function(superClass) {
return class extends superClass {
constructor() {
super();
}
static get properties() {
return {
bar: {
type: Object
}
};
}
}
}
</script>
答案 1 :(得分:0)
这是我的代码,我没有得到任何我知道的警告:p
const GrainUpdateInlineStyleBehavior = subclass => class extends subclass {