mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
添加尺寸错误验证
This commit is contained in:
1 parent
a6816d68fa
commit
a51b0debd9
3 files changed
+14
-9
No files matched your search
@@ -10,9 +10,15 @@ export default class Template {
|
||||
errorHandle(this.$container, `No container element found by ${art.option.container}`);
|
||||
}
|
||||
|
||||
if (art.constructor.instances.some(art => art.template.$container === this.$container)) {
|
||||
errorHandle(false, 'Cannot mount multiple instances on the same dom element');
|
||||
}
|
||||
errorHandle(
|
||||
art.constructor.instances.every(art => art.template.$container !== this.$container),
|
||||
'Cannot mount multiple instances on the same dom element',
|
||||
);
|
||||
|
||||
errorHandle(
|
||||
this.$container.clientWidth && this.$container.clientHeight,
|
||||
'The width and height of the container cannot be 0',
|
||||
);
|
||||
|
||||
if (art.whitelist.state) {
|
||||
this.initDesktop();
|
||||
|
||||
Reference in new issue
Block a user