add error icon

This commit is contained in:
Harvey committed 2022-05-18 13:25:56 +08:00
1 parent 5dbac4897b
commit 2f9e0d49ee
51 files changed
+182 -146

No files matched your search

+13 -2
View File
@@ -1,12 +1,23 @@
import { append } from './utils';
import { append, setStyle } from './utils';
import Component from './utils/component';
export default class Mask extends Component {
constructor(art) {
super(art);
this.name = 'mask';
const { template, icons, events } = art;
append(template.$state, icons.state);
const $state = append(template.$state, icons.state);
const $error = append(template.$state, icons.error);
setStyle($error, 'display', 'none');
art.on('destroy', () => {
setStyle($state, 'display', 'none');
setStyle($error, 'display', null);
});
events.proxy(template.$state, 'click', () => art.play());
}
}