forEach => for

This commit is contained in:
zhw2590582 committed 2022-01-07 22:11:48 +08:00
1 parent 99f5694100
commit 455e2189a7
18 files changed
+159 -103

No files matched your search

+11 -2
View File
@@ -3,10 +3,19 @@ import Component from './utils/component';
export default class Layer extends Component {
constructor(art) {
super(art);
const {
option,
template: { $layer },
} = art;
this.name = 'layer';
this.$parent = art.template.$layer;
this.$parent = $layer;
art.once('ready', () => {
art.option.layers.forEach((item) => this.add(item));
for (let index = 0; index < option.layers.length; index++) {
this.add(option.layers[index]);
}
});
}
}