2018-03-21T14:21:33Z||2018-03-21T14:21:33Z


build(element: Element) {
  const children = element.children;
  for (const child of children) {

  }
}

其中for of会出错:

[ts] Type must have a '[Symbol.iterator]()' method that returns an iterator.

tsconfig.json中加上dom.iterable就好了。

{
    "compilerOptions": {
        "lib": [
            "es5", "es6", "dom", "dom.iterable"
        ]
    }
}