kopia lustrzana https://github.com/shoelace-style/shoelace
add guard
rodzic
169b2867fc
commit
e40744c9ff
|
@ -22,11 +22,13 @@ export class SlResponsiveEmbed extends LitElement {
|
|||
|
||||
@watch('aspectRatio')
|
||||
updateAspectRatio() {
|
||||
const split = this.aspectRatio.split(':');
|
||||
const x = parseInt(split[0]);
|
||||
const y = parseInt(split[1]);
|
||||
if (this.base) {
|
||||
const split = this.aspectRatio.split(':');
|
||||
const x = parseInt(split[0]);
|
||||
const y = parseInt(split[1]);
|
||||
|
||||
this.base.style.paddingBottom = x && y ? `${(y / x) * 100}%` : '';
|
||||
this.base.style.paddingBottom = x && y ? `${(y / x) * 100}%` : '';
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Ładowanie…
Reference in New Issue