2

尝试构建我的聚合物 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>

版本和环境

  • 聚合物 CLI:1.1.0
  • 节点:v6.10.3
  • 操作系统:OSX 10.10.5

有什么问题?

4

2 回答 2

7

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

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

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

      }
    }
</script>
于 2017-07-08T05:26:33.023 回答
0

这就是我拥有的代码,我没有收到任何我知道的警告:p

const GrainUpdateInlineStyleBehavior = subclass => class extends subclass {
于 2017-07-07T06:45:16.150 回答